[Eolfix-cvs] eolfix eolfix.c,1.2,1.3
Brought to you by:
rossta
|
From: Ross S. <ro...@us...> - 2006-01-06 20:53:25
|
Update of /cvsroot/eolfix/eolfix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18997 Modified Files: eolfix.c Log Message: Fixed signal handling Index: eolfix.c =================================================================== RCS file: /cvsroot/eolfix/eolfix/eolfix.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- eolfix.c 4 Jan 2006 11:44:09 -0000 1.2 +++ eolfix.c 6 Jan 2006 20:53:17 -0000 1.3 @@ -7,6 +7,15 @@ TODO ==== +http://packages.debian.org/stable/text/flip + +flip +This program converts line endings of text files between MS-DOS and **IX formats. +It detects binary files in a nearly foolproof way and leaves them alone unless you override this. +It will also leave files alone that are already in the right format and preserves file timestamps. +User interrupts are handled gracefully and no garbage or corrupted files left behind. +'flip' does not convert files to a different character set, and it can not handle Apple Macintosh line endings (CR only). For that (and more), you can use the 'recode' program (package 'recode'). + fix: eolfix -v -s *.c -l *.c support runon options: eolfix -vib -d @@ -2537,10 +2546,26 @@ int main(int argc, char **argv) { List *file_list = NULL; - if (signal(SIGINT, sighandler) == SIG_IGN) - signal(SIGINT, SIG_IGN); - if (signal(SIGTERM, sighandler) == SIG_IGN) - signal(SIGTERM, SIG_IGN); +#ifdef SIGHUP + if (signal(SIGHUP, SIG_IGN) != SIG_IGN) + signal(SIGHUP, sighandler); +#endif +#ifdef SIGINT + if (signal(SIGINT, SIG_IGN) != SIG_IGN) + signal(SIGINT, sighandler); +#endif +#ifdef SIGPIPE + if (signal(SIGPIPE, SIG_IGN) != SIG_IGN) + signal(SIGPIPE, sighandler); +#endif +#ifdef SIGQUIT + if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) + signal(SIGQUIT, sighandler); +#endif +#ifdef SIGTERM + if (signal(SIGTERM, SIG_IGN) != SIG_IGN) + signal(SIGTERM, sighandler); +#endif progname = basename(argv[0]); |