summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-10-16 21:35:11 +0200
committerKay Sievers <kay.sievers@vrfy.org>2008-10-16 21:35:11 +0200
commitc28c4486af3fd970aef599be65e9c2d424765329 (patch)
treed5294e1d5f2fb7ec0164a863c93419d8e402cc94 /udev
parentbe7f7f57012e61b062bd540152a1af529c1509f2 (diff)
run_program: prevent empty last argv entry
Diffstat (limited to 'udev')
-rw-r--r--udev/udev-rules.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index 8b94d40c0b..0bad2171fa 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -138,9 +138,9 @@ static int run_program(struct udev_device *dev, const char *command,
if (strchr(arg, ' ') != NULL) {
char *pos = arg;
- while (pos != NULL) {
+ while (pos != NULL && pos[0] != '\0') {
if (pos[0] == '\'') {
- /* don't separate if in apostrophes */
+ /* do not separate quotes */
pos++;
argv[i] = strsep(&pos, "\'");
while (pos != NULL && pos[0] == ' ')