6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
8 * Miscellaneous string functions.
12 static char *rcsid_strs_c = "$Header$";
15 #include <sys/types.h>
19 extern char *malloc(), *realloc();
22 * Random string functions which should be in the C library..
26 * Make a copy of a string.
34 /* Kludge for sloppy string semantics */
36 printf("NULL != \"\" !!!!\r\n");
42 p = malloc((u_int)len);
43 if (p) bcopy(s, p, len);
47 * Trim whitespace off both ends of a string.
54 while (isspace(*s)) s++;
55 /* skip to end of string */
57 for (t = s; *t; t++) continue;
70 * Case insensitive string compare.
73 int cistrcmp(cp1, cp2)
79 if (isupper(c1 = (*cp1++))) c1 = tolower(c1);
80 if (isupper(c2 = (*cp2++))) c2 = tolower(c2);
81 if (c1 != c2) return c1-c2;