[imp] Libhttpd.ep and ispell

Chuck Hagenbuch chuck@horde.org
Tue, 26 Feb 2002 19:06:12 -0500


Quoting Brad Hazledine <brad.hazledine@caledoncard.com>:

> This seems to work....
> 
> #include<stdio.h>
> 
> int main(void) {
>         int i,c;
>         i=0;
>         fputc('^',stdout);
>         while ((i<4000000) && (!feof(stdin))) {
>                 i++;
>                 c=fgetc(stdin);
>                 if (!feof(stdin)) {
>                         if (c=='\r') c='\n';
>                         fputc(c,stdout);
>                         if (c=='\n') fputc('^',stdout);
>                 }
>         }
>         fclose(stdout);
>         fclose(stdin);
> }
> 
> And we changed the line to...
> exec("echo $tocheck | prefixer | " . $conf['utils']['spellchecker'] . ' -a '
> . 
> $spell_opt, $warnings);

I'm not entirely sure I'm processing what that's doing correctly, but adding 
this:

$tocheck = str_replace("\n", "\n^", $tocheck);

before the exec line seems to have the same effect? Can anyone confirm this?

-chuck

--
Charles Hagenbuch, <chuck@horde.org>
"A dream which helps you to live your reality with dignity
 and justice is a good dream." - Tariq Ramadan