summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRalf Corsépius <corsepiu@fedoraproject.org>2007-10-23 13:20:19 +0200
committerRalf Corsépius <corsepiu@fedoraproject.org>2007-10-23 13:20:19 +0200
commit4c647570dcc4d56a84b8adf12bd0ad61dc4c974c (patch)
treeac50c1a785a2263ce88d1466aee8caf276d11ecf /lib
parent2f40e205403bf39549b3406836b0bde981096904 (diff)
downloadlibrpm-tizen-4c647570dcc4d56a84b8adf12bd0ad61dc4c974c.tar.gz
librpm-tizen-4c647570dcc4d56a84b8adf12bd0ad61dc4c974c.tar.bz2
librpm-tizen-4c647570dcc4d56a84b8adf12bd0ad61dc4c974c.zip
Eliminate dead code in setPathDefault, setVarDefault.
Diffstat (limited to 'lib')
-rw-r--r--lib/rpmrc.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
index 763dcfa69..c6d7f368c 100644
--- a/lib/rpmrc.c
+++ b/lib/rpmrc.c
@@ -419,10 +419,7 @@ const char * lookupInDefaultTable(const char * name,
static void setVarDefault(int var, const char * macroname, const char * val,
const char * body)
{
- if (var >= 0) { /* XXX Dying ... */
- if (rpmGetVar(var)) return;
- rpmSetVar(var, val);
- }
+ assert(!(var >= 0)); /* must not happen */
if (body == NULL)
body = val;
addMacro(NULL, macroname, NULL, body, RMIL_DEFAULT);
@@ -430,24 +427,7 @@ static void setVarDefault(int var, const char * macroname, const char * val,
static void setPathDefault(int var, const char * macroname, const char * subdir)
{
-
- if (var >= 0) { /* XXX Dying ... */
- const char * topdir;
- char * fn;
-
- if (rpmGetVar(var)) return;
-
- topdir = rpmGetPath("%{_topdir}", NULL);
-
- fn = alloca(strlen(topdir) + strlen(subdir) + 2);
- strcpy(fn, topdir);
- if (fn[strlen(topdir) - 1] != '/')
- strcat(fn, "/");
- strcat(fn, subdir);
-
- rpmSetVar(var, fn);
- topdir = _free(topdir);
- }
+ assert(!(var >= 0)); /* must not happen */
if (macroname != NULL) {
#define _TOPDIRMACRO "%{_topdir}/"