summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/parseinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cvs/src/parseinfo.c')
-rw-r--r--contrib/cvs/src/parseinfo.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/contrib/cvs/src/parseinfo.c b/contrib/cvs/src/parseinfo.c
index 27f7d79..0fe9c33 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.
@@ -9,6 +14,7 @@
#include "cvs.h"
#include "getline.h"
#include <assert.h>
+#include "history.h"
extern char *logHistory;
@@ -40,6 +46,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? */
@@ -270,8 +278,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)
@@ -395,8 +402,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)
@@ -436,12 +443,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)
OpenPOWER on IntegriCloud