Trim trailing whitespace from cellname.

Lines starting with # are regarded as comments.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7182 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Björn Groenvall
1999-10-18 15:41:34 +00:00
parent c57c112ea1
commit 6a5c94ca88

View File

@@ -184,10 +184,12 @@ find_cells(char *file, char ***cells, int *index)
if (f == NULL)
return;
while (fgets(cell, sizeof(cell), f)) {
char *nl = strchr(cell, '\n');
if (nl)
*nl = '\0';
if (cell[0] == '\0')
char *t;
t = cell + strlen(cell);
for (; t >= cell; t--)
if (*t == '\n' || *t == '\t' || *t == ' ')
*t = 0;
if (cell[0] == '\0' || cell[0] == '#')
continue;
for(i = 0; i < ind; i++)
if(strcmp((*cells)[i], cell) == 0)