X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/ab950546d30461d08fca588e9e8dfdbd10fef6b0..f0544510815a0cb02d77b9133ede1866747524ab:/usr/src/usr.bin/make/str.c diff --git a/usr/src/usr.bin/make/str.c b/usr/src/usr.bin/make/str.c index fd1c6f9b33..50c9bf9474 100644 --- a/usr/src/usr.bin/make/str.c +++ b/usr/src/usr.bin/make/str.c @@ -1,18 +1,32 @@ -/*- - * str.c -- - * General utilites for handling strings. - * - * Copyright (c) 1988, 1989 by the Regents of the University of California +/* + * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. * Copyright (c) 1988, 1989 by Adam de Boor * Copyright (c) 1989 by Berkeley Softworks + * All rights reserved. * - * Permission to use, copy, modify, and distribute this - * software and its documentation for any non-commercial purpose - * and without fee is hereby granted, provided that the above copyright - * notice appears in all copies. The University of California, - * Berkeley Softworks and Adam de Boor make no representations about - * the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. + * This code is derived from software contributed to Berkeley by + * Adam de Boor. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef lint +static char sccsid[] = "@(#)str.c 5.4 (Berkeley) %G%"; +#endif /* not lint */ + +/*- + * str.c -- + * General utilites for handling strings. * * Interface: * Str_Concat Concatenate two strings, placing some sort @@ -20,16 +34,10 @@ * the two strings, all this under the control * of the STR_ flags given as the third arg. * - * Str_New Duplicate a string and return the copy. - * - * Str_FindSubstring Find a substring within a string (from - * original Sprite libc). + * Str_FindSubstring Find a substring within a string * * Str_Match Pattern match two strings. */ -#ifndef lint -static char *rcsid = "$Id: str.c,v 1.22 89/11/14 13:44:07 adam Exp $ SPRITE (Berkeley)"; -#endif lint #include "make.h" @@ -97,30 +105,7 @@ Str_Concat (s1, s2, flags) } return (result); } - -/*- - *----------------------------------------------------------------------- - * Str_New -- - * Create a new unique copy of the given string - * - * Results: - * A pointer to the new copy of it - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ -char * -Str_New (str) - char *str; /* string to duplicate */ -{ - register char *cp; /* new space */ - cp = malloc (strlen (str) + 1); - (void) strcpy (cp, str); - return (cp); -} - static char DoBackslash (c) char c; @@ -134,7 +119,7 @@ DoBackslash (c) default: return (c); } } - + /*- *----------------------------------------------------------------------- * Str_BreakString -- @@ -265,7 +250,7 @@ Str_BreakString (str, breaks, end, argcPtr) return av; } - + /*- *----------------------------------------------------------------------- * Str_FreeVec -- @@ -290,8 +275,7 @@ Str_FreeVec (count, vecPtr) } free (vecPtr); } -#ifndef Sprite - + /* *---------------------------------------------------------------------- * Str_FindSubstring -- @@ -341,8 +325,6 @@ Str_FindSubstring(string, substring) return (char *) NULL; } -#endif /* !Sprite */ - /* *---------------------------------------------------------------------- *