Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -ru manedit-1.2.1/include/string.h manedit-1.2.1-new/include/string.h
- --- manedit-1.2.1/include/string.h 2008-10-11 20:00:00.000000000 -0300
- +++ manedit-1.2.1-new/include/string.h 2013-05-11 23:26:35.661859737 -0300
- @@ -44,7 +44,7 @@
- extern int strcasecmp(const char *s1, const char *s2);
- #endif
- #ifdef NEED_STRCASESTR
- -extern char *strcasestr(const char *haystack, const char *needle);
- +extern char *strcasestr(const char, const char);
- #endif
- extern int strpfx(const char *s, const char *pfx);
- extern int strcasepfx(const char *s, const char *pfx);
- diff -ru manedit-1.2.1/manedit/string.cpp manedit-1.2.1-new/manedit/string.cpp
- --- manedit-1.2.1/manedit/string.cpp 2008-10-11 20:00:00.000000000 -0300
- +++ manedit-1.2.1-new/manedit/string.cpp 2013-05-11 23:30:43.758505481 -0300
- @@ -27,7 +27,7 @@
- int strcasecmp(const char *s1, const char *s2);
- #endif
- #ifdef NEED_STRCASESTR
- -char *strcasestr(const char *haystack, const char *needle);
- +char *strcasestr(const char, const char);
- #endif
- int strpfx(const char *s, const char *pfx);
- int strcasepfx(const char *s, const char *pfx);
- @@ -216,70 +216,6 @@
- }
- #endif
- -#ifdef NEED_STRCASESTR
- -/*
- - * Case insensitive version of strstr(). Returns the pointer to
- - * needle in haystack if found or NULL on no match.
- - */
- -char *strcasestr(const char *haystack, const char *needle)
- -{
- - const char *sh, *sn;
- -
- - if((haystack == NULL) || (needle == NULL))
- - return(NULL);
- -
- - sh = haystack;
- - while(*sh != '\0')
- - {
- - sn = needle; /* Get starting position of needle */
- -
- - /* Character in needle and haystack at same position the
- - * same (case insensitive)
- - */
- - if(toupper((int)(*sh)) == toupper((int)(*sn)))
- - {
- - const char *sh_needle_start = sh;
- -
- - sh++;
- - sn++;
- -
- - /* Continue iterating through haystack */
- - while(*sh != '\0')
- - {
- - /* End of needle? */
- - if(*sn == '\0')
- - {
- - return((char *)sh_needle_start);
- - }
- - /* Characters differ (case insensitive)? */
- - else if(toupper((int)(*sh)) != toupper((int)(*sn)))
- - {
- - sh++;
- - break;
- - }
- - /* Characters are still matching */
- - else
- - {
- - sh++;
- - sn++;
- - }
- - }
- - /* If the end of the needle has been reached then we
- - * got a match
- - */
- - if(*sn == '\0')
- - return((char *)sh_needle_start);
- - }
- - else
- - {
- - sh++;
- - }
- - }
- -
- - return(NULL);
- -}
- -#endif /* NEED_STRCASESTR */
- -
- /*
- * Checks if the string specified pfx is a prefix of the string
- * specified by s.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement