From 7575169e50dc5330b2540786cf5a768a82c5bd47 Mon Sep 17 00:00:00 2001 From: obrien Date: Sun, 13 Jan 2008 06:10:58 +0000 Subject: [PATCH] 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. --- contrib/cvs/src/parseinfo.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/contrib/cvs/src/parseinfo.c b/contrib/cvs/src/parseinfo.c index 5e34add5ea11..c206fb7ff914 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 , + * 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 +#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)