[Eolfix-cvs] eolfix configure.ac,1.2,1.3 eolfix.c,1.4,1.5 version.h,1.2,1.3
Brought to you by:
rossta
|
From: Ross S. <ro...@us...> - 2006-03-21 16:27:13
|
Update of /cvsroot/eolfix/eolfix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5123 Modified Files: configure.ac eolfix.c version.h Log Message: Added .ico, fixed 'cannot open : No such file or directory' bug, fixed command line parsing bug, bumped version to 0.2.0 Index: eolfix.c =================================================================== RCS file: /cvsroot/eolfix/eolfix/eolfix.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- eolfix.c 6 Jan 2006 21:30:26 -0000 1.4 +++ eolfix.c 21 Mar 2006 16:26:57 -0000 1.5 @@ -764,7 +764,26 @@ /****************************************************************************/ /* per http://www.scit.wlv.ac.uk/cgi-bin/mansec?3C+dirname */ -static char* dirname(char* s) { +static char* dirname(char* path) { + char *p; + + if (path == NULL || *path == '\0') + return "."; + p = path + strlen(path) - 1; + while (IS_PATH_SEPARATOR(*p)) { + if (p == path) + return path; + *p-- = '\0'; + } + + while (p >= path && !IS_PATH_SEPARATOR(*p)) + p--; + + return + p < path ? "." : + p == path ? "/" : + (*p = '\0', path); +/* int i; static char rv[PATH_MAX]; int at_end = 1; @@ -776,7 +795,7 @@ if (i > 0) { if (i > PATH_MAX - 1) return NULL; - strncpy(rv, s, i - 1); + strncpy(rv, s, i); } rv[i] = '\0'; return rv; @@ -786,7 +805,8 @@ } } - return "."; + return "."; +*/ } #define HAVE_DIRNAME 1 @@ -2229,18 +2249,18 @@ static int process_options(List **file_list, int argc, char **argv) { int last_optind = 0; - + int c = 0; + /* turn off getopt's error messages */ opterr = 0; optind = 1; optreset = 1; while (optind < argc) { - int c; int option_index = 0; - if (optind <= last_optind) - optind = last_optind + 1; +// if (optind <= last_optind) +// optind = last_optind + 1; if (optind >= argc) break; @@ -2248,6 +2268,11 @@ if (last_optind < optind) last_optind = optind; +#if defined(__WINDOWS__) + if (optind < argc && argv[optind] && argv[optind][0] == '/') + argv[optind][0] = '-'; +#endif + c = getopt_long(argc, argv, short_options, long_options, &option_index); if (c <= 1) { @@ -2258,7 +2283,8 @@ } break; } - process_filename(file_list, argv[last_optind]); + process_filename(file_list, argv[last_optind]); + ++optind; continue; } @@ -2553,6 +2579,10 @@ int main(int argc, char **argv) { List *file_list = NULL; +#ifdef SIGABRT + if (signal(SIGABRT, SIG_IGN) != SIG_IGN) + signal(SIGABRT, sighandler); +#endif #ifdef SIGHUP if (signal(SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, sighandler); Index: configure.ac =================================================================== RCS file: /cvsroot/eolfix/eolfix/configure.ac,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configure.ac 4 Jan 2006 11:44:57 -0000 1.2 +++ configure.ac 21 Mar 2006 16:26:57 -0000 1.3 @@ -3,11 +3,11 @@ dnl $Id$ MAJOR_VERSION=0 -MINOR_VERSION=1 +MINOR_VERSION=2 RELEASE_NUMBER=0 SUBRELEASE_NUMBER=0 -AC_INIT(eolfix, 0.1.0, [ro...@us...]) +AC_INIT(eolfix, 0.2.0, [ro...@us...]) AC_CONFIG_SRCDIR([eolfix.c]) Index: version.h =================================================================== RCS file: /cvsroot/eolfix/eolfix/version.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- version.h 4 Jan 2006 11:44:57 -0000 1.2 +++ version.h 21 Mar 2006 16:26:57 -0000 1.3 @@ -14,7 +14,7 @@ #define PACKAGE "eolfix" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.1.0" +#define PACKAGE_VERSION "0.2.0" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "ro...@us..." |