summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-06-04 13:10:20 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-06-04 13:10:20 +0800
commitc9fa92954b1c6363d16be1e8b904c2aac7acebe5 (patch)
tree81b877292a1621b7cd201f81641b0aad6d81c3ec
parent7197b9cd1f5da0c2af501ca6590a4594714be733 (diff)
downloadpttbbs-c9fa92954b1c6363d16be1e8b904c2aac7acebe5.tar
pttbbs-c9fa92954b1c6363d16be1e8b904c2aac7acebe5.tar.gz
pttbbs-c9fa92954b1c6363d16be1e8b904c2aac7acebe5.tar.bz2
pttbbs-c9fa92954b1c6363d16be1e8b904c2aac7acebe5.tar.lz
pttbbs-c9fa92954b1c6363d16be1e8b904c2aac7acebe5.tar.xz
pttbbs-c9fa92954b1c6363d16be1e8b904c2aac7acebe5.tar.zst
pttbbs-c9fa92954b1c6363d16be1e8b904c2aac7acebe5.zip
strcasestr() is OS dependent function
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2052 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/proto.h4
-rw-r--r--mbbsd/edit.c15
-rw-r--r--mbbsd/osdep.c15
3 files changed, 18 insertions, 16 deletions
diff --git a/include/proto.h b/include/proto.h
index a0b22fc2..066df340 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -188,7 +188,6 @@ int dice_main(void);
int vedit(char *fpath, int saveheader, int *islocal);
void write_header(FILE *fp);
void addsignature(FILE *fp, int ifuseanony);
-char *strcasestr(const char *big, const char *little);
void auto_backup(void);
void restore_backup(void);
char *ask_tmpbuf(int y);
@@ -366,6 +365,9 @@ char *completeutmp_getname(int where);
/* osdep */
int cpuload(char *str);
double swapused(long *total, long *used);
+#ifdef __linux__
+char *strcasestr(const char *big, const char *little);
+#endif
/* othello */
int othello_main(void);
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index e420b584..d8c7d80f 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1182,21 +1182,6 @@ goto_line(int lino)
redraw_everything = YEA;
}
-char *
-strcasestr(const char *big, const char *little)
-{
- char *ans = (char *)big;
- int len = strlen(little);
- char *endptr = (char *)big + strlen(big) - len;
-
- while (ans <= endptr)
- if (!strncasecmp(ans, little, len))
- return ans;
- else
- ans++;
- return 0;
-}
-
/*
* mode: 0: prompt 1: forward -1: backward
*/
diff --git a/mbbsd/osdep.c b/mbbsd/osdep.c
index 4e6d286e..73af3f85 100644
--- a/mbbsd/osdep.c
+++ b/mbbsd/osdep.c
@@ -139,6 +139,21 @@ size_t strlcpy(dst, src, siz)
return(s - src - 1); /* count does not include NUL */
}
+char *
+strcasestr(const char *big, const char *little)
+{
+ char *ans = (char *)big;
+ int len = strlen(little);
+ char *endptr = (char *)big + strlen(big) - len;
+
+ while (ans <= endptr)
+ if (!strncasecmp(ans, little, len))
+ return ans;
+ else
+ ans++;
+ return 0;
+}
+
#endif
#if __FreeBSD__