jartool.c (add_to_jar): Only compare file to jarfile if jarfile is non-NULL.
authorJakub Jelinek <jakub@redhat.com>
Sun, 10 Nov 2002 21:04:24 +0000 (22:04 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 10 Nov 2002 21:04:24 +0000 (22:04 +0100)
* jartool.c (add_to_jar): Only compare file to jarfile if jarfile is
non-NULL.

* configure.in (AC_CHECK_HEADERS): Add limits.h.
* configure, config.h.in: Rebuilt.

From-SVN: r58990

fastjar/ChangeLog
fastjar/config.h.in
fastjar/configure
fastjar/configure.in
fastjar/jartool.c

index 9ca8ac821a82f0936719eeee51c8c80127217bcf..3cf963b1b45e2c68852e55b84b3b72b8cc93f516 100644 (file)
@@ -1,3 +1,11 @@
+2002-10-10  Jakub Jelinek  <jakub@redhat.com>
+
+       * jartool.c (add_to_jar): Only compare file to jarfile if jarfile is
+       non-NULL.
+
+       * configure.in (AC_CHECK_HEADERS): Add limits.h.
+       * configure, config.h.in: Rebuilt.
+
 2002-11-07  Tom Tromey  <tromey@redhat.com>
 
        * dostime.c: Rewrote from scratch.
index ae4fb96c5cb8af9601939caf942f02941e12157e..05d0c6ec1f54c7ffa2e25eeb626a68c693d52dd5 100644 (file)
@@ -21,6 +21,9 @@
 /* Define if you have the <stdlib.h> header file.  */
 #undef HAVE_STDLIB_H
 
+/* Define if you have the <limits.h> header file.  */
+#undef HAVE_LIMITS_H
+
 /* Define if you have the <sys/dir.h> header file.  */
 #undef HAVE_SYS_DIR_H
 
index 719d3e32b0547fe2128b99967896d906a8755a95..4cc1b926a700586f0ebf6fcd6628e35d15467940 100755 (executable)
@@ -1691,7 +1691,7 @@ EOF
 
 fi
 
-for ac_hdr in fcntl.h unistd.h sys/param.h stdlib.h
+for ac_hdr in fcntl.h unistd.h sys/param.h stdlib.h limits.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
index c2e686e0f8c4437c7050d9bdf1f6c383dea7feda..a1e4676a7dc65e27fc4711e5f278cfbfbdf8cf66 100644 (file)
@@ -24,7 +24,7 @@ dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_STRUCT_TM
-AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h stdlib.h)
+AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h stdlib.h limits.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_OFF_T
index 3048ee9c213afc16d0f93948a9658b6517bfaca5..cd2efcb109f3e300f4600a2db642c1f67bada775 100644 (file)
@@ -843,7 +843,7 @@ int add_to_jar(int fd, const char *new_dir, const char *file){
     }
   }
 
-  if(!strcmp(file, jarfile)){
+  if(jarfile && !strcmp(file, jarfile)){
     if(verbose)
       printf("skipping: %s\n", file);
     return 0;  /* we don't want to add ourselves.. */
@@ -924,7 +924,8 @@ int add_to_jar(int fd, const char *new_dir, const char *file){
     while(!use_explicit_list_only && (de = readdir(dir)) != NULL){
       if(de->d_name[0] == '.')
         continue;
-      if(!strcmp(de->d_name, jarfile)){ /* we don't want to add ourselves.  Believe me */
+      if(jarfile && !strcmp(de->d_name, jarfile)){
+       /* we don't want to add ourselves.  Believe me */
         if(verbose)
           printf("skipping: %s\n", de->d_name);
         continue;