src/gedlib/lloptions.c
/*==========================================
 * copy_process -- copy config value line,
 *  converting any escape characters
 *  This handles \n, \t, and \\
 *  We do not trim out backslashes, unless they 
 *  are part of escape sequences. (This is mostly
 *  because backslashes are so prevalent in
 *  MS-Windows paths.)
 * The output (dest) is no longer than the input (src).
 * Created: 2001/11/09, Perry Rapp
 *========================================*/
- copy config value line,
converting any escape characters
This handles \n, \t, and
We do not trim out backslashes, unless they
are part of escape sequences. (This is mostly
because backslashes are so prevalent in
MS-Windows paths.)
The output (dest) is no longer than the input (src).
- copy config value line converting any escape characters This handles \ n \ t and We do not trim out backslashes unless they are part of escape sequences . ( This is mostly because backslashes are so prevalent in MS - Windows paths . ) The output ( dest ) is no longer than the input ( src ) .
static void
copy_process (STRING dest, STRING src)
{
	STRING q=dest,p=src;
	while ((*q = *p++)) {
		if (*q == '\\') {
			switch (*p++) {
			case 0:
				*++q = 0;
				break;
			case 'n':
				*q = '\n';
				break;
			case 't':
				*q  = '\t';
				break;
			case '\\':
				*q = '\\';
				break;
			default:
				--p;
			}
		}
		++q;
	}
}
static void copy_process ( STRING dest , STRING src ) { STRING q = dest , p = src ; while ( ( * q = * p ++ ) ) { if ( * q == ' \\ ' ) { switch ( * p ++ ) { case 0 : * ++ q = 0 ; break ; case ' ' : * q = ' \n ' ; break ; case ' ' : * q = ' \t ' ; break ; case ' \\ ' : * q = ' \\ ' ; break ; default : -- p ; } } ++ q ; } }
copy_process -- copy config value line,
  converting any escape characters
  This handles \n, \t, and \\
  We do not trim out backslashes, unless they
  are part of escape sequences.
copy_process -- copy config value line converting any escape characters This handles \ n \ t and \\ We do not trim out backslashes unless they are part of escape sequences .