projects
/
tools
/
librpm-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2addde
)
Simplify setPathDefault()
author
Panu Matilainen
<pmatilai@redhat.com>
Fri, 25 Apr 2008 10:39:44 +0000
(13:39 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Fri, 25 Apr 2008 12:28:45 +0000
(15:28 +0300)
- use rpmGetPath() to get sanitized path, avoid alloca()
lib/rpmrc.c
patch
|
blob
|
history
diff --git
a/lib/rpmrc.c
b/lib/rpmrc.c
index
18ffd01
..
9dd9d69
100644
(file)
--- a/
lib/rpmrc.c
+++ b/
lib/rpmrc.c
@@
-438,12
+438,9
@@
static void setPathDefault(const char * macroname, const char * subdir)
{
if (macroname != NULL) {
-#define _TOPDIRMACRO "%{_topdir}/"
- char *body = alloca(sizeof(_TOPDIRMACRO) + strlen(subdir));
- strcpy(body, _TOPDIRMACRO);
- strcat(body, subdir);
+ char *body = rpmGetPath("%{_topdir}/", subdir, NULL);
addMacro(NULL, macroname, NULL, body, RMIL_DEFAULT);
-#undef _TOPDIRMACRO
+ free(body);
}
}