chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
execute: minor cleanups
[elogind.git]
/
conf-parser.c
diff --git
a/conf-parser.c
b/conf-parser.c
index aebf61aaf5067a77086be7594c0d0b14506b95dc..712b4e489c3fc9e7c35988d3b79978ead1bd458d 100644
(file)
--- a/
conf-parser.c
+++ b/
conf-parser.c
@@
-32,7
+32,6
@@
#include "log.h"
#define COMMENTS "#;\n"
#include "log.h"
#define COMMENTS "#;\n"
-#define NEWLINES "\n\r"
#define LINE_MAX 4096
/* Run the user supplied parser for an assignment */
#define LINE_MAX 4096
/* Run the user supplied parser for an assignment */
@@
-368,8
+367,12
@@
int config_parse_strv(
if (!(n = new(char*, k+1)))
return -ENOMEM;
if (!(n = new(char*, k+1)))
return -ENOMEM;
- for (k = 0; (*sv)[k]; k++)
- n[k] = (*sv)[k];
+ if (*sv)
+ for (k = 0; (*sv)[k]; k++)
+ n[k] = (*sv)[k];
+ else
+ k = 0;
+
FOREACH_WORD_QUOTED(w, l, rvalue, state)
if (!(n[k++] = strndup(w, l)))
goto fail;
FOREACH_WORD_QUOTED(w, l, rvalue, state)
if (!(n[k++] = strndup(w, l)))
goto fail;