"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/datei.cc" between
worker-4.7.0.tar.bz2 and worker-4.8.0.tar.bz2

About: Worker is a file manager for the X Window System with the classical two panel interface.

datei.cc  (worker-4.7.0.tar.bz2):datei.cc  (worker-4.8.0.tar.bz2)
skipping to change at line 1190 skipping to change at line 1190
str1 += id; str1 += id;
str1 += " = "; str1 += " = ";
str1 += buf; str1 += buf;
str1 += ","; str1 += ",";
sprintf( buf, "%d", num2 ); sprintf( buf, "%d", num2 );
str1 += buf; str1 += buf;
str1 += ";"; str1 += ";";
putLine( str1.c_str() ); putLine( str1.c_str() );
} }
void Datei::configPutPairString( const char *id, const char *str ) void Datei::configPutPairString( const char *id, const char *str, bool escape_ne wlines )
{ {
std::string str1; std::string str1;
char *buf; char *buf;
int i, o; int i, o;
int x; int x;
if ( ( id == NULL ) || ( str == NULL ) ) return; if ( ( id == NULL ) || ( str == NULL ) ) return;
str1 = ""; str1 = "";
for ( x = 0; x < sectiondepth; x++ ) str1 += "\t"; for ( x = 0; x < sectiondepth; x++ ) str1 += "\t";
buf = (char*)_allocsafe( strlen( str ) * 2 + 1 ); buf = (char*)_allocsafe( strlen( str ) * 2 + 1 );
for ( i = 0, o = 0; i < (int)strlen( str ); i++ ) { for ( i = 0, o = 0; i < (int)strlen( str ); i++ ) {
if ( str[i] == '"' ) { if ( str[i] == '"' ) {
buf[o++] = '\\'; buf[o++] = '\\';
buf[o++] = '"'; buf[o++] = '"';
} else if ( str[i] == '\\' ) { } else if ( str[i] == '\\' ) {
buf[o++] = '\\'; buf[o++] = '\\';
buf[o++] = '\\'; buf[o++] = '\\';
} else if ( str[i] == '\n' ) {
if ( escape_newlines ) {
buf[o++] = '\\';
buf[o++] = '\n';
}
} else { } else {
buf[o++] = str[i]; buf[o++] = str[i];
} }
} }
buf[o] = '\0'; buf[o] = '\0';
str1 += id; str1 += id;
str1 += " = \""; str1 += " = \"";
str1 += buf; str1 += buf;
str1 += "\";"; str1 += "\";";
_freesafe( buf ); _freesafe( buf );
skipping to change at line 1252 skipping to change at line 1257
if ( str == NULL ) return; if ( str == NULL ) return;
str1 = ""; str1 = "";
for ( x = 0; x < sectiondepth; x++ ) str1 += "\t"; for ( x = 0; x < sectiondepth; x++ ) str1 += "\t";
str1 += str; str1 += str;
if ( semicolon == true ) str1 += ";"; if ( semicolon == true ) str1 += ";";
putLine( str1.c_str() ); putLine( str1.c_str() );
} }
void Datei::configPutString( const char *str, bool semicolon ) void Datei::configPutString( const char *str, bool semicolon, bool escape_newlin es )
{ {
std::string str1; std::string str1;
char *buf; char *buf;
int i, o; int i, o;
int x; int x;
if ( str == NULL ) return; if ( str == NULL ) return;
str1 = ""; str1 = "";
for ( x = 0; x < sectiondepth; x++ ) str1 += "\t"; for ( x = 0; x < sectiondepth; x++ ) str1 += "\t";
buf = (char*)_allocsafe( strlen( str ) * 2 + 1 ); buf = (char*)_allocsafe( strlen( str ) * 2 + 1 );
for ( i = 0, o = 0; i < (int)strlen( str ); i++ ) { for ( i = 0, o = 0; i < (int)strlen( str ); i++ ) {
if ( str[i] == '"' ) { if ( str[i] == '"' ) {
buf[o++] = '\\'; buf[o++] = '\\';
buf[o++] = '"'; buf[o++] = '"';
} else if ( str[i] == '\\' ) { } else if ( str[i] == '\\' ) {
buf[o++] = '\\'; buf[o++] = '\\';
buf[o++] = '\\'; buf[o++] = '\\';
} else if ( str[i] == '\n' ) {
if ( escape_newlines ) {
buf[o++] = '\\';
buf[o++] = '\n';
}
} else { } else {
buf[o++] = str[i]; buf[o++] = str[i];
} }
} }
buf[o] = '\0'; buf[o] = '\0';
str1 += "\""; str1 += "\"";
str1 += buf; str1 += buf;
str1 += "\";"; str1 += "\";";
_freesafe( buf ); _freesafe( buf );
putLine( str1.c_str() ); putLine( str1.c_str() );
 End of changes. 4 change blocks. 
2 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)