diff options
author | Antti-Juhani Kaijanaho <ajk@debian.org> | 2006-01-28 21:54:43 +0100 |
---|---|---|
committer | Antti-Juhani Kaijanaho <ajk@debian.org> | 2006-01-28 21:54:43 +0100 |
commit | 16b7d1d595749bbdf8c102dddc706387dbf3d920 (patch) | |
tree | 9890819d4b43859a00d14653d7aa2823188c230c /rc.c | |
parent | 096f494a778f83317db75632e6bc5c45bd5d521a (diff) | |
download | dctrl-tools-16b7d1d595749bbdf8c102dddc706387dbf3d920.tar.gz |
Import 2.4
Diffstat (limited to 'rc.c')
-rw-r--r-- | rc.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -50,9 +50,10 @@ char const * const ifile_modes[] = { [m_error] = "m_error", static struct ifile parse(char * s) { + if (s == 0) return (struct ifile) { .mode = m_read, .s = "-" }; s = (char*)left_trimmed(s); trim_right(s); - if (s == 0) return (struct ifile) { .mode = m_read, .s = "-" }; + if (*s == 0) return (struct ifile) { .mode = m_read, .s = "-" }; static const char at_exec[] = "@exec "; if (s[0] != '@') return (struct ifile){ .mode = m_read, .s = s }; assert(s[0] == '@'); @@ -153,12 +154,14 @@ struct ifile find_ifile_by_exename(const char * exename, const char * rcfname) } ++lineno; - if (line[0] == 0) { + + if (*line == 0) { rv = 0; break; } chop_comment(line, '#'); + chomp(line); if (left_trimmed(line) [0] == 0) { continue; |