summaryrefslogtreecommitdiff
path: root/build/parsePrep.c
diff options
context:
space:
mode:
authorJindrich Novy <jnovy@redhat.com>2008-12-09 12:47:50 +0100
committerJindrich Novy <jnovy@redhat.com>2008-12-09 12:47:50 +0100
commit2ba56c673bf1c168cccb827938c09f5ff2a3beda (patch)
tree1b5259a509ca297181201343ad2bbf8f664c80e3 /build/parsePrep.c
parent0643dd44e6e243870868b0fb8196adad1632dfbb (diff)
downloadlibrpm-tizen-2ba56c673bf1c168cccb827938c09f5ff2a3beda.tar.gz
librpm-tizen-2ba56c673bf1c168cccb827938c09f5ff2a3beda.tar.bz2
librpm-tizen-2ba56c673bf1c168cccb827938c09f5ff2a3beda.zip
Move declarations of local variables for parsing functions
from global scope. Compilers aren't that stupid these days
Diffstat (limited to 'build/parsePrep.c')
-rw-r--r--build/parsePrep.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c
index 34906c8a6..fbb63db34 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -11,21 +11,6 @@
#include <rpm/rpmfileutil.h>
#include "debug.h"
-/* These have to be global to make up for stupid compilers */
- static int leaveDirs, skipDefaultAction;
- static int createDir, quietly;
-static const char * dirName = NULL;
-static struct poptOption optionsTable[] = {
- { NULL, 'a', POPT_ARG_STRING, NULL, 'a', NULL, NULL},
- { NULL, 'b', POPT_ARG_STRING, NULL, 'b', NULL, NULL},
- { NULL, 'c', 0, &createDir, 0, NULL, NULL},
- { NULL, 'D', 0, &leaveDirs, 0, NULL, NULL},
- { NULL, 'n', POPT_ARG_STRING, &dirName, 0, NULL, NULL},
- { NULL, 'T', 0, &skipDefaultAction, 0, NULL, NULL},
- { NULL, 'q', 0, &quietly, 0, NULL, NULL},
- { 0, 0, 0, 0, 0, NULL, NULL}
- };
-
/**
* Check that file owner and group are known.
* @param urlfn file url
@@ -262,10 +247,19 @@ static int doSetupMacro(rpmSpec spec, const char *line)
const char * optArg;
int rc;
uint32_t num;
-
- leaveDirs = skipDefaultAction = 0;
- createDir = quietly = 0;
- dirName = NULL;
+ int leaveDirs = 0, skipDefaultAction = 0;
+ int createDir = 0, quietly = 0;
+ const char * dirName = NULL;
+ struct poptOption optionsTable[] = {
+ { NULL, 'a', POPT_ARG_STRING, NULL, 'a', NULL, NULL},
+ { NULL, 'b', POPT_ARG_STRING, NULL, 'b', NULL, NULL},
+ { NULL, 'c', 0, &createDir, 0, NULL, NULL},
+ { NULL, 'D', 0, &leaveDirs, 0, NULL, NULL},
+ { NULL, 'n', POPT_ARG_STRING, &dirName, 0, NULL, NULL},
+ { NULL, 'T', 0, &skipDefaultAction, 0, NULL, NULL},
+ { NULL, 'q', 0, &quietly, 0, NULL, NULL},
+ { 0, 0, 0, 0, 0, NULL, NULL}
+ };
if ((rc = poptParseArgvString(line, &argc, &argv))) {
rpmlog(RPMLOG_ERR, _("Error parsing %%setup: %s\n"),