Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/usr.bin/make/str.c,v rcsdiff: /ftp/cvs/cvsroot/src/usr.bin/make/str.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.12 retrieving revision 1.12.4.1 diff -u -p -r1.12 -r1.12.4.1 --- src/usr.bin/make/str.c 1996/03/29 02:17:34 1.12 +++ src/usr.bin/make/str.c 1997/01/26 05:51:51 1.12.4.1 @@ -1,8 +1,8 @@ -/* $NetBSD: str.c,v 1.12 1996/03/29 02:17:34 jtc Exp $ */ +/* $NetBSD: str.c,v 1.12.4.1 1997/01/26 05:51:51 rat Exp $ */ /*- - * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. - * Copyright (c) 1988, 1989 by Adam de Boor + * Copyright (c) 1988, 1989, 1990, 1993 + * The Regents of the University of California. All rights reserved. * Copyright (c) 1989 by Berkeley Softworks * All rights reserved. * @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; #else -static char rcsid[] = "$NetBSD: str.c,v 1.12 1996/03/29 02:17:34 jtc Exp $"; +static char rcsid[] = "$NetBSD: str.c,v 1.12.4.1 1997/01/26 05:51:51 rat Exp $"; #endif #endif /* not lint */ @@ -73,8 +73,9 @@ str_init() void str_end() { - if (argv[0]) { - free(argv[0]); + if (argv) { + if (argv[0]) + free(argv[0]); free((Address) argv); } if (buffer) @@ -222,7 +223,7 @@ brk_string(str, store_argc, expand) ch = *++p; break; } - + switch (ch = *++p) { case '\0': case '\n': @@ -259,12 +260,12 @@ done: argv[argc] = (char *)NULL; /* * Str_FindSubstring -- See if a string contains a particular substring. - * + * * Results: 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. Matching is done on an exact * character-for-character basis with no wildcards or special characters. - * + * * Side effects: None. */ char * @@ -297,13 +298,13 @@ Str_FindSubstring(string, substring) /* * Str_Match -- - * + * * See if a particular string matches a particular pattern. - * + * * Results: Non-zero is returned if string matches pattern, 0 otherwise. The * matching operation permits the following special characters in the * pattern: *?\[] (see the man page for details on what these mean). - * + * * Side effects: None. */ int @@ -400,8 +401,8 @@ thisCharOK: ++pattern; /*- *----------------------------------------------------------------------- * Str_SYSVMatch -- - * Check word against pattern for a match (% is wild), - * + * Check word against pattern for a match (% is wild), + * * Results: * Returns the beginning position of a match or null. The number * of characters matched is returned in len. @@ -451,7 +452,7 @@ Str_SYSVMatch(word, pattern, len) return m; } while (*w++ != '\0'); - + return NULL; } @@ -462,7 +463,7 @@ Str_SYSVMatch(word, pattern, len) * Substitute '%' on the pattern with len characters from src. * If the pattern does not contain a '%' prepend len characters * from src. - * + * * Results: * None *