From: hno <> Date: Thu, 12 Jul 2001 04:29:50 +0000 (+0000) Subject: Bugzilla #194 X-Git-Tag: SQUID_3_0_PRE1~1471 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb6bd0bdd5c2060b86608ea46032d1b61fa8277d;p=thirdparty%2Fsquid.git Bugzilla #194 Compilation fails on index() on some non-BSD plaforms should use strchr() instead --- diff --git a/src/fs/aufs/store_dir_aufs.cc b/src/fs/aufs/store_dir_aufs.cc index d542e2114b..a8ae11c666 100644 --- a/src/fs/aufs/store_dir_aufs.cc +++ b/src/fs/aufs/store_dir_aufs.cc @@ -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++); diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 03598b2a8b..cdf9d3dafa 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -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++); diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index 64b9dc7551..3f45b28b0b 100644 --- a/src/fs/diskd/store_dir_diskd.cc +++ b/src/fs/diskd/store_dir_diskd.cc @@ -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++); diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index 937b4974bd..d8b3424aef 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -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++);