summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-01-17 23:42:11 +0000
committerMatt Wilson <msw@redhat.com>2001-01-17 23:42:11 +0000
commit97fc8bf1dc91f7a68350b2680f1a4daa89c7efcd (patch)
tree6b8ad653119873861bad77e4a74c1ee7bc3f3dcc /utils
parent56a0ae05980137b7673e3a583320a1b93aa2a23a (diff)
downloadanaconda-97fc8bf1dc91f7a68350b2680f1a4daa89c7efcd.tar.gz
anaconda-97fc8bf1dc91f7a68350b2680f1a4daa89c7efcd.tar.xz
anaconda-97fc8bf1dc91f7a68350b2680f1a4daa89c7efcd.zip
fix usage text, count properly
Diffstat (limited to 'utils')
-rw-r--r--utils/genhdlist.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/utils/genhdlist.c b/utils/genhdlist.c
index 7f4daface..71211070a 100644
--- a/utils/genhdlist.c
+++ b/utils/genhdlist.c
@@ -44,22 +44,24 @@ char ** depOrder = NULL;
/* mmmm... linear search */
int getOrder (char * fn)
{
- char *p = NULL;
- int i = 0;
+ char *p;
+ int i;
if (!depOrder || !depOrder[0] || !depOrder[0][0]) {
return -1;
}
+
+ i = -1;
+ do {
+ i++;
+ p = depOrder[i];
+ } while (p && *p && strncmp (fn, p, strlen(p)));
- p = depOrder[i];
- while (p && *p && strncmp (fn, p, strlen(p))) {
- p = depOrder[i++];
- }
if (p) {
return i;
}
- return -1;
+ return i;
}
int onePass(FD_t outfd, const char * dirName, int cdNum) {
@@ -203,7 +205,7 @@ int onePass(FD_t outfd, const char * dirName, int cdNum) {
}
static void usage(void) {
- fprintf(stderr, "genhdlist: genhdlist [--withnumbers] [--hdlist <path>] <paths>+\n");
+ fprintf(stderr, "genhdlist: genhdlist [--withnumbers] [--pkgorder <path>] [--hdlist <path>] <paths>+\n");
exit(1);
}
@@ -269,7 +271,6 @@ int main(int argc, const char ** argv) {
len = strlen(buf);
depOrder[numpkgs] = malloc (len + 1);
- /* chomp off \n */
strcpy (depOrder[numpkgs], buf);
numpkgs++;
}