Subversion Repositories SvarDOS

Rev

Rev 2042 | Rev 2044 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2042 Rev 2043
Line 1156... Line 1156...
1156
 
1156
 
1157
  return subdirsInInitialpath;
1157
  return subdirsInInitialpath;
1158
}
1158
}
1159
 
1159
 
1160
 
1160
 
1161
/**
-
 
1162
 * Process strings, converting \\, \n, \r, and \t to actual chars.
-
 
1163
 * This method is used to allow the message catalog to use \\, \n, \r, and \t
-
 
1164
 * returns a pointer to its internal buffer, so strcpy soon after use.
-
 
1165
 * Can only handle lines up to MAXLINE chars.
-
 
1166
 * This is required because most messages are passed as
-
 
1167
 * string arguments to printf, and not actually parsed by it.
-
 
1168
 */
-
 
1169
static char *processLine(char *line) {
-
 
1170
  static char buffer[MAXLINE+MAXLINE];
-
 
1171
  char *src = line, *dst = buffer;
-
 
1172
 
-
 
1173
  if (line == NULL) return NULL;
-
 
1174
 
-
 
1175
  /* cycle through copying characters, except when a \ is encountered. */
-
 
1176
  for ( ; *src != '\0'; src++, dst++)
-
 
1177
  {
-
 
1178
    if (*src == '\\')
-
 
1179
    {
-
 
1180
      src++;
-
 
1181
      switch (*src)
-
 
1182
      {
-
 
1183
	  case '\0': /* a slash ends a line, ignore the slash. */
-
 
1184
		  src--; /* next time through will see the '\0'    */
-
 
1185
		  break;
-
 
1186
	  case '\\': /* a single slash */
-
 
1187
		  *dst = '\\';
-
 
1188
		  break;
-
 
1189
	  case 'n': /* a newline */
-
 
1190
		  *dst = '\n';
-
 
1191
		  break;
-
 
1192
	  case 'r': /* a carriage return */
-
 
1193
		  *dst = '\r';
-
 
1194
		  break;
-
 
1195
	  case 't': /* a horizontal tab */
-
 
1196
		  *dst = '\t';
-
 
1197
		  break;
-
 
1198
	  default: /* just copy over the letter */
-
 
1199
		  *dst = *src;
-
 
1200
		  break;
-
 
1201
      }
-
 
1202
    }
-
 
1203
    else
-
 
1204
      *dst = *src;
-
 
1205
  }
-
 
1206
 
-
 
1207
  /* ensure '\0' terminated */
-
 
1208
  *dst = '\0';
-
 
1209
 
-
 
1210
  return buffer;
-
 
1211
}
-
 
1212
 
-
 
1213
 
-
 
1214
static void FixOptionText(void) {
1161
static void FixOptionText(void) {
1215
  char buffer[MAXLINE];  /* sprintf can have problems with src==dest */
1162
  char buffer[MAXLINE];  /* sprintf can have problems with src==dest */
1216
 
1163
 
1217
  /* Handle %c for options within messages using Set 8 */
1164
  /* Handle %c for options within messages using Set 8 */
1218
  strcpy(buffer, treeUsage);
1165
  strcpy(buffer, treeUsage);