cs program spins wildly on getopt()
"sunsetbrew" <[email protected]> Mon, 08 Feb 2010 17:55:55 -0000
| Newsgroups | gmane.text.clearsilver.general |
|---|---|
| Message-ID | <[email protected]> |
I cross compiled this for ARM and the cs program appeared to hang on startup. After debugging, it was determined to be this line#50 in cs.c because EOF is -1 and c is a char type so this condition was never met. while ((c = getopt(argc, argv, "Hvh:c:")) != EOF ) The fix is to make c of type int on line 33. - char c;+ int c; The build for ARM was pretty painless only the make depends does not work right and none of the build-time tests work since it is being cross-compiled. One last observation. The cs program rules for the quick and dirty, but it would be even cooler to have the flexibility of cs with the cgi functions built into it. When trying to use http_escape() with a cs processed template, it fails of course. The cgiwrapper is cool, but in my use case cs is better, so I guess I will just write another cs. Cheers!Thomas