summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-05-12 08:32:19 +0000
committerRoy Marples <roy@marples.name>2008-05-12 08:32:19 +0000
commitb732df31efa47244a88a0faf8d503e96da1b0777 (patch)
treec6623a83f8ee81a0e64a63f197aa26a369be5e1f
parent762dc3d197c9383f746547dde2ad81543861166f (diff)
downloadopenrc-b732df31efa47244a88a0faf8d503e96da1b0777.tar.gz
openrc-b732df31efa47244a88a0faf8d503e96da1b0777.tar.bz2
openrc-b732df31efa47244a88a0faf8d503e96da1b0777.tar.xz
Don't report fstab passno of 0 when using greater or less than, #76.
-rw-r--r--src/rc/fstabinfo.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/rc/fstabinfo.c b/src/rc/fstabinfo.c
index 644f353..65b3993 100644
--- a/src/rc/fstabinfo.c
+++ b/src/rc/fstabinfo.c
@@ -159,7 +159,7 @@ int fstabinfo(int argc, char **argv)
struct ENT *ent;
int result = EXIT_SUCCESS;
char *token;
- int i;
+ int i, p;
int opt;
int output = OUTPUT_FILE;
RC_STRINGLIST *files = rc_stringlist_new();
@@ -200,13 +200,17 @@ int fstabinfo(int argc, char **argv)
argv[0], optarg + 1);
filtered = true;
+ opt = optarg[0];
START_ENT;
while ((ent = GET_ENT)) {
- if (((optarg[0] == '=' && i == ENT_PASS(ent)) ||
- (optarg[0] == '<' && i > ENT_PASS(ent)) ||
- (optarg[0] == '>' && i < ENT_PASS(ent))) &&
- strcmp(ENT_FILE(ent), "none") != 0)
- rc_stringlist_add(files, ENT_FILE(ent));
+ if (strcmp(ENT_FILE(ent), "none") == 0)
+ continue;
+ p = ENT_PASS(ent);
+ if ((opt == '=' && i == p) ||
+ (opt == '<' && i > p && p != 0) ||
+ (opt == '>' && i < p && p != 0))
+ rc_stringlist_add(files,
+ ENT_FILE(ent));
}
END_ENT;
break;