Switch to CVS 1.12.11
[dragonfly.git] / gnu / usr.bin / cvs / cvs / parseinfo.c.patch
1 $DragonFly: src/gnu/usr.bin/cvs/cvs/Attic/parseinfo.c.patch,v 1.2 2005/03/13 11:43:07 corecode Exp $
2 --- /usr/src/contrib/cvs-1.12.11/src/parseinfo.c        2005-01-05 22:17:43.000000000 +0100
3 +++ parseinfo.c 2005-03-06 23:57:22.000000000 +0100
4 @@ -333,8 +333,8 @@
5   *
6   *   xmalloc() failures are fatal, per usual.
7   */
8 -struct config *
9 -parse_config (const char *cvsroot)
10 +static struct config *
11 +parse_config_file (const char *cvsroot, const char *config_name, struct config *retval)
12  {
13      char *infopath;
14      FILE *fp_info;
15 @@ -342,13 +342,13 @@
16      size_t line_allocated = 0;
17      size_t len;
18      char *p;
19 -    struct config *retval;
20  
21      TRACE (TRACE_FUNCTION, "parse_config (%s)", cvsroot);
22  
23 -    retval = new_config ();
24 +    if (retval == NULL)
25 +       retval = new_config ();
26  
27 -    infopath = Xasprintf ("%s/%s/%s", cvsroot, CVSROOTADM, CVSROOTADM_CONFIG);
28 +    infopath = Xasprintf ("%s/%s/%s", cvsroot, CVSROOTADM, config_name);
29  
30      fp_info = CVS_FOPEN (infopath, "r");
31      if (fp_info == NULL)
32 @@ -431,9 +431,11 @@
33             readBool (infopath, "SystemAuth", p, &dummy);
34         }
35  #endif
36 -       else if (strcmp (line, "LocalKeyword") == 0)
37 +       else if (strcmp (line, "LocalKeyword") == 0 ||
38 +                strcmp (line, "tag") == 0)
39             RCS_setlocalid (&retval->keywords, p);
40 -       else if (strcmp (line, "KeywordExpand") == 0)
41 +       else if (strcmp (line, "KeywordExpand") == 0 ||
42 +                strcmp (line, "tagexpand") == 0)
43             RCS_setincexc (&retval->keywords, p);
44         else if (strcmp (line, "PreservePermissions") == 0)
45  #ifdef PRESERVE_PERMISSIONS_SUPPORT
46 @@ -547,3 +549,15 @@
47         free (line);
48      return retval;
49  }
50 +
51 +struct config *
52 +parse_config (const char *cvsroot)
53 +{
54 +    struct config *retval;
55 +
56 +    retval = NULL;
57 +    retval = parse_config_file (cvsroot, CVSROOTADM_CONFIG, retval);
58 +    retval = parse_config_file (cvsroot, CVSROOTADM_OPTIONS, retval);
59 +
60 +    return retval;
61 +}