|
Lines 235-240
Link Here
|
| 235 |
#endif /* SERVER_SUPPORT || CLIENT_SUPPORT */ |
235 |
#endif /* SERVER_SUPPORT || CLIENT_SUPPORT */ |
| 236 |
|
236 |
|
| 237 |
/* |
237 |
/* |
|
|
238 |
* Remove fmt str specifier other than %% or %s. And allow |
| 239 |
* only max_s %s specifiers |
| 240 |
*/ |
| 241 |
wrap_clean_fmt_str(char *fmt, int max_s) |
| 242 |
{ |
| 243 |
while (*fmt) { |
| 244 |
if (fmt[0] == '%' && fmt[1]) |
| 245 |
{ |
| 246 |
if (fmt[1] == '%') |
| 247 |
fmt++; |
| 248 |
else |
| 249 |
if (fmt[1] == 's' && max_s > 0) |
| 250 |
{ |
| 251 |
max_s--; |
| 252 |
fmt++; |
| 253 |
} else |
| 254 |
*fmt = ' '; |
| 255 |
} |
| 256 |
fmt++; |
| 257 |
} |
| 258 |
return; |
| 259 |
} |
| 260 |
|
| 261 |
/* |
| 238 |
* Open a file and read lines, feeding each line to a line parser. Arrange |
262 |
* Open a file and read lines, feeding each line to a line parser. Arrange |
| 239 |
* for keeping a temporary list of wrappers at the end, if the "temp" |
263 |
* for keeping a temporary list of wrappers at the end, if the "temp" |
| 240 |
* argument is set. |
264 |
* argument is set. |
|
Lines 540-548
Link Here
|
| 540 |
args = xmalloc (strlen (e->tocvsFilter) |
564 |
args = xmalloc (strlen (e->tocvsFilter) |
| 541 |
+ strlen (fileName) |
565 |
+ strlen (fileName) |
| 542 |
+ strlen (buf)); |
566 |
+ strlen (buf)); |
| 543 |
/* FIXME: sprintf will blow up if the format string contains items other |
567 |
|
| 544 |
than %s, or contains too many %s's. We should instead be parsing |
568 |
wrap_clean_fmt_str(e->tocvsFilter, 2); |
| 545 |
e->tocvsFilter ourselves and giving a real error. */ |
|
|
| 546 |
sprintf (args, e->tocvsFilter, fileName, buf); |
569 |
sprintf (args, e->tocvsFilter, fileName, buf); |
| 547 |
run_setup (args); |
570 |
run_setup (args); |
| 548 |
run_exec(RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL|RUN_REALLY ); |
571 |
run_exec(RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL|RUN_REALLY ); |
|
Lines 572-580
Link Here
|
| 572 |
|
595 |
|
| 573 |
args = xmalloc (strlen (e->fromcvsFilter) |
596 |
args = xmalloc (strlen (e->fromcvsFilter) |
| 574 |
+ strlen (fileName)); |
597 |
+ strlen (fileName)); |
| 575 |
/* FIXME: sprintf will blow up if the format string contains items other |
598 |
|
| 576 |
than %s, or contains too many %s's. We should instead be parsing |
599 |
wrap_clean_fmt_str(e->fromcvsFilter, 1); |
| 577 |
e->fromcvsFilter ourselves and giving a real error. */ |
|
|
| 578 |
sprintf (args, e->fromcvsFilter, fileName); |
600 |
sprintf (args, e->fromcvsFilter, fileName); |
| 579 |
run_setup (args); |
601 |
run_setup (args); |
| 580 |
run_exec(RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL ); |
602 |
run_exec(RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL ); |