Patch: fastjar -vs- Irix

Tom Tromey tromey@redhat.com
Wed Dec 13 10:11:00 GMT 2000


This patch lets fastjar build on Irix.  fastjar was using index(), and
I simply changed it to use strchr().

Are there any systems that only have index()?  I know there were in
the distant past.  It seems unlikely that there would be any left (or
that we would care about them), but I've been suprised before.

I'm checking this in.  I will update it to use index() if somebody
thinks that is really important.

2000-12-13  Tom Tromey  <tromey@redhat.com>

	* jartool.c (extract_jar): Use strchr, not index.

Tom

Index: jartool.c
===================================================================
RCS file: /cvs/gcc/egcs/fastjar/jartool.c,v
retrieving revision 1.1
diff -u -r1.1 jartool.c
--- jartool.c	2000/12/09 03:08:23	1.1
+++ jartool.c	2000/12/13 18:04:47
@@ -1,6 +1,6 @@
 /*
   jartool.c - main functions for fastjar utility
-  Copyright (C) 1999  Bryan Burns
+  Copyright (C) 1999, 2000  Bryan Burns
   
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
@@ -1271,7 +1271,7 @@
     /* OK, there is some directory information in the file.  Nothing to do
        but ensure the directory(s) exist, and create them if they don't.
        What a pain! */
-    if(index(filename, '/') != NULL && handle){
+    if(strchr(filename, '/') != NULL && handle){
       /* Loop through all the directories in the path, (everything w/ a '/') */
       ub1 *start = filename;
       char *tmp_buff;
@@ -1280,7 +1280,7 @@
       tmp_buff = malloc(sizeof(char) * strlen(filename));
 
       for(;;){
-        ub1 *idx = index(start, '/');
+        ub1 *idx = strchr(start, '/');
 
         if(idx == NULL)
           break;


More information about the Gcc-patches mailing list