Re: feedback, comments on this php-delimiter scrubbing program?

2009-06-16 Thread Gary Kline
On Mon, Jun 15, 2009 at 06:57:45PM -0800, Mel Flynn wrote: On Monday 15 June 2009 17:21:16 Gary Kline wrote: Encl: dephp.c, test case '?': ch = getchar(); while (1) { if (ch == '?' (ch = getchar()) == '') {

Re: feedback, comments on this php-delimiter scrubbing program?

2009-06-16 Thread Gary Kline
On Tue, Jun 16, 2009 at 08:30:40AM -0700, Gary Kline wrote: On Mon, Jun 15, 2009 at 06:57:45PM -0800, Mel Flynn wrote: On Monday 15 June 2009 17:21:16 Gary Kline wrote: Encl: dephp.c, test case '?': ch = getchar(); while (1) {

Re: feedback, comments on this php-delimiter scrubbing program?

2009-06-16 Thread Jeffrey Goldberg
On Jun 16, 2009, at 10:30 AM, Gary Kline wrote: I thought my initial getchar() != EOF would handle that. But then there's that do-forever loop. As I said, the most common problem people had was failing to check of EOF in all the places it could occur, and so looping forever.

Re: feedback, comments on this php-delimiter scrubbing program?

2009-06-16 Thread Jeffrey Goldberg
On Jun 16, 2009, at 12:02 PM, Gary Kline wrote: this works, but still gives a warning. it's sloppy coding, but as a second version... You've got some superfluous tests for EOF in some places, and you may also be missing some. Your approach has been to look ahead with an

Re: feedback, comments on this php-delimiter scrubbing program?

2009-06-16 Thread Gary Kline
On Tue, Jun 16, 2009 at 06:32:43PM -0500, Jeffrey Goldberg wrote: On Jun 16, 2009, at 12:02 PM, Gary Kline wrote: this works, but still gives a warning. it's sloppy coding, but as a second version... You've got some superfluous tests for EOF in some places, and you may also

feedback, comments on this php-delimiter scrubbing program?

2009-06-15 Thread Gary Kline
guys, last night i was lost with a slightly shorter version of this. even looking at a printout did nothing. this morning i had another go and went in a corner and started at the code. finally i figured it out. this *seems* to work... The only thing this does is remove the ? and ? delimiters.

Re: feedback, comments on this php-delimiter scrubbing program?

2009-06-15 Thread Mel Flynn
On Monday 15 June 2009 17:21:16 Gary Kline wrote: Encl: dephp.c, test case '?': ch = getchar(); while (1) { if (ch == '?' (ch = getchar()) == '') { break; } else