Changeset 1822
- Timestamp:
- 09/19/06 17:24:29 (2 years ago)
- Files:
-
- trunk/swish-e/src/filter.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/swish-e/src/filter.c
r1799 r1822 51 51 static char *filterCallCmdOptParam2(char *str, char param, FileProp * fp); 52 52 static char *filterCallCmdOptStr(char *opt_mask, FileProp * fprop); 53 53 static void stringQuote(char *str); 54 54 55 55 … … 335 335 /* if no filter cmd param given, use default */ 336 336 337 opt_mask = (fi->options && *(fi->options) ) ? fi->options : " '%p' '%P'";337 opt_mask = (fi->options && *(fi->options) ) ? fi->options : "%p %P"; 338 338 cmd_opts = filterCallCmdOptStr(opt_mask, fprop); 339 339 … … 385 385 *co, 386 386 *om; 387 int max = MAXSTRLEN * 3;387 int max = MAXSTRLEN *4; 388 388 389 389 … … 396 396 397 397 /* Argh! no overflow checking. Fix $$$ - Mar 2002 - moseley */ 398 398 399 399 switch (*om) { 400 400 … … 432 432 case 'P': /* Full Doc Path/URL */ 433 433 strcpy(str, (fprop->real_path) ? fprop->real_path : nul); 434 stringQuote(str); 434 435 break; 435 436 436 437 case 'p': /* Full Path TMP/Work path */ 437 438 strcpy(str, (fprop->work_path) ? fprop->work_path : nul); 439 stringQuote(str); 438 440 #if defined(_WIN32) && !defined(__CYGWIN__) 439 441 make_windows_path( str ); … … 481 483 } 482 484 483 485 /* 486 * Fix for Debian: escape all non alphanum characters in paths 487 * -- Ludovic Drolez 488 */ 489 void stringQuote(char *str) 490 { 491 char *copy; 492 493 copy = (char *) emalloc(strlen(str)+1); 494 strcpy(copy, str); 495 496 for ( ;*copy; ) { 497 if (!isalnum(*copy) && (*copy != '/') ) { 498 *str++ = '\\'; 499 } 500 *str++ = *copy++; 501 } 502 *str = 0; 503 504 efree(copy); 505 }
