Advertisement
arkanon

manedit-1.2.1-ubuntu-13.04.patch

May 11th, 2013
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.55 KB | None | 0 0
  1. diff -ru manedit-1.2.1/include/string.h manedit-1.2.1-new/include/string.h
  2. --- manedit-1.2.1/include/string.h  2008-10-11 20:00:00.000000000 -0300
  3. +++ manedit-1.2.1-new/include/string.h  2013-05-11 23:26:35.661859737 -0300
  4. @@ -44,7 +44,7 @@
  5.  extern int strcasecmp(const char *s1, const char *s2);
  6.  #endif
  7.  #ifdef NEED_STRCASESTR
  8. -extern char *strcasestr(const char *haystack, const char *needle);
  9. +extern char *strcasestr(const char, const char);
  10.  #endif
  11.  extern int strpfx(const char *s, const char *pfx);
  12.  extern int strcasepfx(const char *s, const char *pfx);
  13. diff -ru manedit-1.2.1/manedit/string.cpp manedit-1.2.1-new/manedit/string.cpp
  14. --- manedit-1.2.1/manedit/string.cpp    2008-10-11 20:00:00.000000000 -0300
  15. +++ manedit-1.2.1-new/manedit/string.cpp    2013-05-11 23:30:43.758505481 -0300
  16. @@ -27,7 +27,7 @@
  17.  int strcasecmp(const char *s1, const char *s2);
  18.  #endif
  19.  #ifdef NEED_STRCASESTR
  20. -char *strcasestr(const char *haystack, const char *needle);
  21. +char *strcasestr(const char, const char);
  22.  #endif
  23.  int strpfx(const char *s, const char *pfx);
  24.  int strcasepfx(const char *s, const char *pfx);
  25. @@ -216,70 +216,6 @@
  26.  }
  27.  #endif
  28.  
  29. -#ifdef NEED_STRCASESTR
  30. -/*
  31. - * Case insensitive version of strstr(). Returns the pointer to
  32. - * needle in haystack if found or NULL on no match.
  33. - */
  34. -char *strcasestr(const char *haystack, const char *needle)
  35. -{
  36. -   const char *sh, *sn;
  37. -
  38. -   if((haystack == NULL) || (needle == NULL))
  39. -       return(NULL);
  40. -
  41. -   sh = haystack;
  42. -   while(*sh != '\0')
  43. -   {
  44. -       sn = needle;    /* Get starting position of needle */
  45. -
  46. -       /* Character in needle and haystack at same position the
  47. -        * same (case insensitive)
  48. -        */
  49. -       if(toupper((int)(*sh)) == toupper((int)(*sn)))
  50. -       {
  51. -       const char *sh_needle_start = sh;
  52. -
  53. -       sh++;
  54. -       sn++;
  55. -
  56. -       /* Continue iterating through haystack */
  57. -       while(*sh != '\0')
  58. -       {
  59. -           /* End of needle? */
  60. -           if(*sn == '\0')
  61. -           {
  62. -           return((char *)sh_needle_start);
  63. -           }
  64. -           /* Characters differ (case insensitive)? */
  65. -           else if(toupper((int)(*sh)) != toupper((int)(*sn)))
  66. -           {
  67. -           sh++;
  68. -           break;
  69. -           }
  70. -           /* Characters are still matching */
  71. -           else
  72. -           {
  73. -           sh++;
  74. -           sn++;
  75. -           }
  76. -       }
  77. -       /* If the end of the needle has been reached then we
  78. -        * got a match
  79. -        */
  80. -       if(*sn == '\0')
  81. -           return((char *)sh_needle_start);
  82. -       }
  83. -       else
  84. -       {
  85. -       sh++;
  86. -       }
  87. -   }
  88. -
  89. -   return(NULL);
  90. -}
  91. -#endif /* NEED_STRCASESTR */
  92. -
  93.  /*
  94.   * Checks if the string specified pfx is a prefix of the string
  95.   * specified by s.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement