]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugzilla #194
authorhno <>
Thu, 12 Jul 2001 04:29:50 +0000 (04:29 +0000)
committerhno <>
Thu, 12 Jul 2001 04:29:50 +0000 (04:29 +0000)
Compilation fails on index() on some non-BSD plaforms

should use strchr() instead

src/fs/aufs/store_dir_aufs.cc
src/fs/coss/store_dir_coss.cc
src/fs/diskd/store_dir_diskd.cc
src/fs/ufs/store_dir_ufs.cc

index d542e2114bdd3f8824686e6c9c6dd41616c5b380..a8ae11c666a55d48cfb6d38ef2c7b3fc63f226b9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_aufs.cc,v 1.35 2001/05/08 15:24:36 hno Exp $
+ * $Id: store_dir_aufs.cc,v 1.36 2001/07/11 22:29:50 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -295,8 +295,9 @@ storeAufsDirSwapLogFile(SwapDir * sd, const char *ext)
     char *pathtmp2;
     if (Config.Log.swap) {
        xstrncpy(pathtmp, sd->path, SQUID_MAXPATHLEN - 64);
-       while (index(pathtmp, '/'))
-           *index(pathtmp, '/') = '.';
+       pathtmp2 = pathtmp;
+       while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL)
+           *pathtmp2 = '.';
        while (strlen(pathtmp) && pathtmp[strlen(pathtmp) - 1] == '.')
            pathtmp[strlen(pathtmp) - 1] = '\0';
        for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++);
index 03598b2a8b39317c226e17cf54373e58ff15e2c6..cdf9d3dafa7ab53db72b7742c32f48cafdf492d7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.cc,v 1.22 2001/05/08 15:34:45 hno Exp $
+ * $Id: store_dir_coss.cc,v 1.23 2001/07/11 22:29:50 hno Exp $
  *
  * DEBUG: section 81    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -99,8 +99,9 @@ storeCossDirSwapLogFile(SwapDir * sd, const char *ext)
     char *pathtmp2;
     if (Config.Log.swap) {
        xstrncpy(pathtmp, sd->path, SQUID_MAXPATHLEN - 64);
-       while (index(pathtmp, '/'))
-           *index(pathtmp, '/') = '.';
+       pathtmp2 = pathtmp;
+       while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL)
+           *pathtmp2 = '.';
        while (strlen(pathtmp) && pathtmp[strlen(pathtmp) - 1] == '.')
            pathtmp[strlen(pathtmp) - 1] = '\0';
        for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++);
index 64b9dc755166928160414d3b2452b187312261ee..3f45b28b0b4feb8d97f72ffeb11e769ae89461a9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_diskd.cc,v 1.52 2001/07/10 15:35:45 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.53 2001/07/11 22:29:50 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -305,8 +305,9 @@ storeDiskdDirSwapLogFile(SwapDir * sd, const char *ext)
     char *pathtmp2;
     if (Config.Log.swap) {
        xstrncpy(pathtmp, sd->path, SQUID_MAXPATHLEN - 64);
-       while (index(pathtmp, '/'))
-           *index(pathtmp, '/') = '.';
+       pathtmp2 = pathtmp;
+       while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL)
+           *pathtmp2 = '.';
        while (strlen(pathtmp) && pathtmp[strlen(pathtmp) - 1] == '.')
            pathtmp[strlen(pathtmp) - 1] = '\0';
        for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++);
index 937b4974bddbf29a29576ff9949eeb2fe1dba89d..d8b3424aef55ff19d751a94a9dd42da9b32f609c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_ufs.cc,v 1.34 2001/05/08 15:24:37 hno Exp $
+ * $Id: store_dir_ufs.cc,v 1.35 2001/07/11 22:29:51 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -292,8 +292,9 @@ storeUfsDirSwapLogFile(SwapDir * sd, const char *ext)
     char *pathtmp2;
     if (Config.Log.swap) {
        xstrncpy(pathtmp, sd->path, SQUID_MAXPATHLEN - 64);
-       while (index(pathtmp, '/'))
-           *index(pathtmp, '/') = '.';
+       pathtmp2 = pathtmp;
+       while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL)
+           *pathtmp2 = '.';
        while (strlen(pathtmp) && pathtmp[strlen(pathtmp) - 1] == '.')
            pathtmp[strlen(pathtmp) - 1] = '\0';
        for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++);