[pisa-src] r1366 - trunk/libpisa/util.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Wed, 28 Oct 2009 12:32:52 +0100

Author: tjansen
Date: Wed Oct 28 12:32:52 2009
New Revision: 1366

Log:
Removed unused function pisa_findsubstring.

Modified:
   trunk/libpisa/util.c

Modified: trunk/libpisa/util.c
==============================================================================
--- trunk/libpisa/util.c        Wed Oct 28 12:27:19 2009        (r1365)
+++ trunk/libpisa/util.c        Wed Oct 28 12:32:52 2009        (r1366)
@@ -183,32 +183,6 @@
        }
 }
 
-/*
- * Checks if a string contains a particular substring.
- *
- * If string contains substring, the return value is the location of
- * the first matching instance of substring in string.  If string doesn't
- * contain substring, the return value is NULL.  
- */
-char *pisa_findsubstring(const char *string, const char *substring) {
-  char *str = (char *) string, *sub = (char *) substring;
-  char *a, *b;
-  
-  for (b = sub; *str != 0; str += 1) {
-    if (*str != *b)
-      continue;
-    a = str;
-    for (;;) {
-      if (*b == 0)
-       return(str);
-      if (*a++ != *b++)
-       break;
-    }
-    b = sub;
-  }
-  return((char *) NULL);
-}
-
 /** pisa_timeval_diff - calculate difference between two timevalues
  * @param t1     timevalue 1
  * @param t2     timevalue 2

Other related posts:

  • » [pisa-src] r1366 - trunk/libpisa/util.c - Thomas Jansen