Don't report fstab passno of 0 when using greater or less than, #76.
This commit is contained in:
parent
762dc3d197
commit
b732df31ef
@ -159,7 +159,7 @@ int fstabinfo(int argc, char **argv)
|
|||||||
struct ENT *ent;
|
struct ENT *ent;
|
||||||
int result = EXIT_SUCCESS;
|
int result = EXIT_SUCCESS;
|
||||||
char *token;
|
char *token;
|
||||||
int i;
|
int i, p;
|
||||||
int opt;
|
int opt;
|
||||||
int output = OUTPUT_FILE;
|
int output = OUTPUT_FILE;
|
||||||
RC_STRINGLIST *files = rc_stringlist_new();
|
RC_STRINGLIST *files = rc_stringlist_new();
|
||||||
@ -200,13 +200,17 @@ int fstabinfo(int argc, char **argv)
|
|||||||
argv[0], optarg + 1);
|
argv[0], optarg + 1);
|
||||||
|
|
||||||
filtered = true;
|
filtered = true;
|
||||||
|
opt = optarg[0];
|
||||||
START_ENT;
|
START_ENT;
|
||||||
while ((ent = GET_ENT)) {
|
while ((ent = GET_ENT)) {
|
||||||
if (((optarg[0] == '=' && i == ENT_PASS(ent)) ||
|
if (strcmp(ENT_FILE(ent), "none") == 0)
|
||||||
(optarg[0] == '<' && i > ENT_PASS(ent)) ||
|
continue;
|
||||||
(optarg[0] == '>' && i < ENT_PASS(ent))) &&
|
p = ENT_PASS(ent);
|
||||||
strcmp(ENT_FILE(ent), "none") != 0)
|
if ((opt == '=' && i == p) ||
|
||||||
rc_stringlist_add(files, ENT_FILE(ent));
|
(opt == '<' && i > p && p != 0) ||
|
||||||
|
(opt == '>' && i < p && p != 0))
|
||||||
|
rc_stringlist_add(files,
|
||||||
|
ENT_FILE(ent));
|
||||||
}
|
}
|
||||||
END_ENT;
|
END_ENT;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user