diff options
author | obrien <obrien@FreeBSD.org> | 2008-01-13 06:10:58 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2008-01-13 06:10:58 +0000 |
commit | 7575169e50dc5330b2540786cf5a768a82c5bd47 (patch) | |
tree | 7bba696498f0c6413ad9718124ac9ad1543db8c0 /contrib/cvs/src | |
parent | 89cdc741853eb82b998a9f575b1d1c29e1310d0c (diff) | |
download | FreeBSD-src-7575169e50dc5330b2540786cf5a768a82c5bd47.zip FreeBSD-src-7575169e50dc5330b2540786cf5a768a82c5bd47.tar.gz |
Merge rev 1.2 (extensions to the $CVSROOT/config syntax) and
rev 1.4 (1.12 CVSROOT/config keyword expansion forward compatability)
into version 1.11.22.
Diffstat (limited to 'contrib/cvs/src')
-rw-r--r-- | contrib/cvs/src/parseinfo.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/contrib/cvs/src/parseinfo.c b/contrib/cvs/src/parseinfo.c index 5e34add..c206fb7 100644 --- a/contrib/cvs/src/parseinfo.c +++ b/contrib/cvs/src/parseinfo.c @@ -1,6 +1,11 @@ /* - * Copyright (c) 1992, Brian Berliner and Jeff Polk - * Copyright (c) 1989-1992, Brian Berliner + * Copyright (C) 1986-2005 The Free Software Foundation, Inc. + * + * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>, + * and others. + * + * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk + * Portions Copyright (C) 1989-1992, Brian Berliner * * You may distribute under the terms of the GNU General Public License as * specified in the README file that comes with the CVS source distribution. @@ -11,6 +16,7 @@ #include "cvs.h" #include "getline.h" #include <assert.h> +#include "history.h" extern char *logHistory; @@ -42,6 +48,8 @@ Parse_Info (infofile, repository, callproc, all) const char *srepos; const char *regex_err; + assert (repository); + if (current_parsed_root == NULL) { /* XXX - should be error maybe? */ @@ -272,8 +280,7 @@ parse_config (cvsroot) value, currently at least. */ error (0, errno, "cannot open %s", infopath); } - free (infopath); - return 0; + goto set_defaults_and_return; } while (getline (&line, &line_allocated, fp_info) >= 0) @@ -416,8 +423,8 @@ warning: this CVS does not support PreservePermissions"); { if (strcmp (p, "all") != 0) { - logHistory=xmalloc(strlen (p) + 1); - strcpy (logHistory, p); + if (logHistory) free (logHistory); + logHistory = xstrdup (p); } } else if (strcmp (line, "RereadLogAfterVerify") == 0) @@ -467,12 +474,17 @@ warning: this CVS does not support PreservePermissions"); error (0, errno, "cannot close %s", infopath); goto error_return; } +set_defaults_and_return: + if (!logHistory) + logHistory = xstrdup (ALL_HISTORY_REC_TYPES); free (infopath); if (line != NULL) free (line); return 0; error_return: + if (!logHistory) + logHistory = xstrdup (ALL_HISTORY_REC_TYPES); if (infopath != NULL) free (infopath); if (line != NULL) |