diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-04 12:44:06 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-04 12:44:06 +0100 |
commit | 6cc77995e9132054d884b970c0b320d5bf68045a (patch) | |
tree | 6c957a38930682b8f1526ed8762b3e76678a4ed1 /lib | |
parent | dce6d94d8b7ed2971ce1bc45eee0600439039fbd (diff) | |
download | abrt-6cc77995e9132054d884b970c0b320d5bf68045a.tar.gz abrt-6cc77995e9132054d884b970c0b320d5bf68045a.tar.xz abrt-6cc77995e9132054d884b970c0b320d5bf68045a.zip |
fix a simple bug in run_event() - was truncating command at first word
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/run_event.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/utils/run_event.c b/lib/utils/run_event.c index 80c8d04d..5103560c 100644 --- a/lib/utils/run_event.c +++ b/lib/utils/run_event.c @@ -57,13 +57,16 @@ int run_event(struct run_event_state *state, { char *end_word = skip_non_whitespace(p); char *next_word = skip_whitespace(end_word); - *end_word = '\0'; + + /* *end_word = '\0'; - BUG, truncates command */ /* If there is no '=' in this word... */ char *line_val = strchr(p, '='); - if (!line_val) + if (!line_val || line_val >= end_word) break; /* ...we found the start of a command */ + *end_word = '\0'; + /* Current word has VAR=VAL form. line_val => VAL */ *line_val++ = '\0'; |