summaryrefslogtreecommitdiff
path: root/rc.c
diff options
context:
space:
mode:
authorAntti-Juhani Kaijanaho <ajk@debian.org>2006-01-28 21:54:43 +0100
committerAntti-Juhani Kaijanaho <ajk@debian.org>2006-01-28 21:54:43 +0100
commit16b7d1d595749bbdf8c102dddc706387dbf3d920 (patch)
tree9890819d4b43859a00d14653d7aa2823188c230c /rc.c
parent096f494a778f83317db75632e6bc5c45bd5d521a (diff)
downloaddctrl-tools-16b7d1d595749bbdf8c102dddc706387dbf3d920.tar.gz
Import 2.4
Diffstat (limited to 'rc.c')
-rw-r--r--rc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/rc.c b/rc.c
index 4f4a1d6..b23803b 100644
--- a/rc.c
+++ b/rc.c
@@ -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;