Deleted Added
full compact
fileattr.c (32785) fileattr.c (44852)
1/* Implementation for file attribute munging features.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,

--- 97 unchanged lines hidden (view full) ---

106 /* Remove trailing newline. */
107 line[nread - 1] = '\0';
108 if (line[0] == 'F')
109 {
110 char *p;
111 Node *newnode;
112
113 p = strchr (line, '\t');
1/* Implementation for file attribute munging features.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,

--- 97 unchanged lines hidden (view full) ---

106 /* Remove trailing newline. */
107 line[nread - 1] = '\0';
108 if (line[0] == 'F')
109 {
110 char *p;
111 Node *newnode;
112
113 p = strchr (line, '\t');
114 if (p == NULL)
115 error (1, 0,
116 "file attribute database corruption: tab missing in %s",
117 fname);
114 *p++ = '\0';
115 newnode = getnode ();
116 newnode->type = FILEATTR;
117 newnode->delproc = fileattr_delproc;
118 newnode->key = xstrdup (line + 1);
119 newnode->data = xstrdup (p);
120 if (addnode (attrlist, newnode) != 0)
121 /* If the same filename appears twice in the file, discard
122 any line other than the first for that filename. This
123 is the way that CVS has behaved since file attributes
124 were first introduced. */
125 free (newnode);
126 }
127 else if (line[0] == 'D')
128 {
129 char *p;
130 /* Currently nothing to skip here, but for future expansion,
131 ignore anything located here. */
132 p = strchr (line, '\t');
118 *p++ = '\0';
119 newnode = getnode ();
120 newnode->type = FILEATTR;
121 newnode->delproc = fileattr_delproc;
122 newnode->key = xstrdup (line + 1);
123 newnode->data = xstrdup (p);
124 if (addnode (attrlist, newnode) != 0)
125 /* If the same filename appears twice in the file, discard
126 any line other than the first for that filename. This
127 is the way that CVS has behaved since file attributes
128 were first introduced. */
129 free (newnode);
130 }
131 else if (line[0] == 'D')
132 {
133 char *p;
134 /* Currently nothing to skip here, but for future expansion,
135 ignore anything located here. */
136 p = strchr (line, '\t');
137 if (p == NULL)
138 error (1, 0,
139 "file attribute database corruption: tab missing in %s",
140 fname);
133 ++p;
134 fileattr_default_attrs = xstrdup (p);
135 }
136 else
137 {
138 /* Unrecognized type, we want to just preserve the line without
139 changing it, for future expansion. */
140 struct unrecog *new;

--- 504 unchanged lines hidden ---
141 ++p;
142 fileattr_default_attrs = xstrdup (p);
143 }
144 else
145 {
146 /* Unrecognized type, we want to just preserve the line without
147 changing it, for future expansion. */
148 struct unrecog *new;

--- 504 unchanged lines hidden ---