diff options
Diffstat (limited to 'contrib/cvs/src/parseinfo.c')
-rw-r--r-- | contrib/cvs/src/parseinfo.c | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/contrib/cvs/src/parseinfo.c b/contrib/cvs/src/parseinfo.c index 1c1ab70..0bf6d3c 100644 --- a/contrib/cvs/src/parseinfo.c +++ b/contrib/cvs/src/parseinfo.c @@ -10,6 +10,8 @@ #include "getline.h" #include <assert.h> +extern char *logHistory; + /* * Parse the INFOFILE file for the specified REPOSITORY. Invoke CALLPROC for * the first line in the file that matches the REPOSITORY, or if ALL != 0, any lines @@ -32,7 +34,7 @@ Parse_Info (infofile, repository, callproc, all) char *default_value = NULL; char *expanded_value= NULL; int callback_done, line_number; - char *cp, *exp, *value, *srepos; + char *cp, *exp, *value, *srepos, bad; const char *regex_err; if (CVSroot_original == NULL) @@ -110,10 +112,6 @@ Parse_Info (infofile, repository, callproc, all) if (expanded_value != NULL) free (expanded_value); expanded_value = expand_path (value, infofile, line_number); - if (!expanded_value) - { - continue; - } /* * At this point, exp points to the regular expression, and value @@ -127,9 +125,10 @@ Parse_Info (infofile, repository, callproc, all) { /* Is it OK to silently ignore all but the last DEFAULT expression? */ - if (default_value != NULL) + if (default_value != NULL && default_value != &bad) free (default_value); - default_value = xstrdup (expanded_value); + default_value = (expanded_value != NULL ? + xstrdup (expanded_value) : &bad); continue; } @@ -140,11 +139,13 @@ Parse_Info (infofile, repository, callproc, all) */ if (strcmp (exp, "ALL") == 0) { - if (all) - err += callproc (repository, expanded_value); - else + if (!all) error(0, 0, "Keyword `ALL' is ignored at line %d in %s file", line_number, infofile); + else if (expanded_value != NULL) + err += callproc (repository, expanded_value); + else + err++; continue; } @@ -163,7 +164,10 @@ Parse_Info (infofile, repository, callproc, all) continue; /* no match */ /* it did, so do the callback and note that we did one */ - err += callproc (repository, expanded_value); + if (expanded_value != NULL) + err += callproc (repository, expanded_value); + else + err++; callback_done = 1; } if (ferror (fp_info)) @@ -173,10 +177,15 @@ Parse_Info (infofile, repository, callproc, all) /* if we fell through and didn't callback at all, do the default */ if (callback_done == 0 && default_value != NULL) - err += callproc (repository, default_value); + { + if (default_value != &bad) + err += callproc (repository, default_value); + else + err++; + } /* free up space if necessary */ - if (default_value != NULL) + if (default_value != NULL && default_value != &bad) free (default_value); if (expanded_value != NULL) free (expanded_value); @@ -367,6 +376,14 @@ warning: this CVS does not support PreservePermissions"); opendir it or something, but I don't see any particular reason to do that now rather than waiting until lock.c. */ } + else if (strcmp (line, "LogHistory") == 0) + { + if (strcmp (p, "all") != 0) + { + logHistory=malloc(strlen (p) + 1); + strcpy (logHistory, p); + } + } else { /* We may be dealing with a keyword which was added in a |