chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a6fde35
)
path-util.c: small modernization
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Sun, 8 Sep 2013 11:31:25 +0000
(07:31 -0400)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 9 Sep 2013 17:49:30 +0000
(13:49 -0400)
src/shared/path-util.c
patch
|
blob
|
history
diff --git
a/src/shared/path-util.c
b/src/shared/path-util.c
index 0c1b6a0ab04240c672431035ad28ff551899b608..68881357784eba69f4cd8d165b32f903f058323e 100644
(file)
--- a/
src/shared/path-util.c
+++ b/
src/shared/path-util.c
@@
-102,7
+102,8
@@
char **path_split_and_make_absolute(const char *p) {
char **l;
assert(p);
char **l;
assert(p);
- if (!(l = strv_split(p, ":")))
+ l = strv_split(p, ":");
+ if (!l)
return NULL;
if (!path_strv_make_absolute_cwd(l)) {
return NULL;
if (!path_strv_make_absolute_cwd(l)) {
@@
-126,7
+127,7
@@
char *path_make_absolute(const char *p, const char *prefix) {
}
char *path_make_absolute_cwd(const char *p) {
}
char *path_make_absolute_cwd(const char *p) {
-
char *cwd, *r
;
+
_cleanup_free_ char *cwd = NULL
;
assert(p);
assert(p);
@@
-140,10
+141,7
@@
char *path_make_absolute_cwd(const char *p) {
if (!cwd)
return NULL;
if (!cwd)
return NULL;
- r = path_make_absolute(p, cwd);
- free(cwd);
-
- return r;
+ return path_make_absolute(p, cwd);
}
char **path_strv_make_absolute_cwd(char **l) {
}
char **path_strv_make_absolute_cwd(char **l) {
@@
-156,7
+154,8
@@
char **path_strv_make_absolute_cwd(char **l) {
STRV_FOREACH(s, l) {
char *t;
STRV_FOREACH(s, l) {
char *t;
- if (!(t = path_make_absolute_cwd(*s)))
+ t = path_make_absolute_cwd(*s);
+ if (!t)
return NULL;
free(*s);
return NULL;
free(*s);