Fix fstabinfo -p /
This commit is contained in:
parent
2569e85579
commit
49b8b30ab7
@ -111,32 +111,33 @@ int main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'p':
|
case 'p':
|
||||||
switch (optarg[0]) {
|
switch (optarg[0]) {
|
||||||
case '=':
|
case '=':
|
||||||
case '<':
|
case '<':
|
||||||
case '>':
|
case '>':
|
||||||
if (sscanf (optarg + 1, "%d", &n) != 1)
|
if (sscanf (optarg + 1, "%d", &n) != 1)
|
||||||
eerrorx ("%s: invalid passno %s", argv[0], optarg + 1);
|
eerrorx ("%s: invalid passno %s", argv[0], optarg + 1);
|
||||||
|
|
||||||
while ((ent = GET_ENT)) {
|
while ((ent = GET_ENT)) {
|
||||||
if (((optarg[0] == '=' && n == ENT_PASS (ent)) ||
|
if (((optarg[0] == '=' && n == ENT_PASS (ent)) ||
|
||||||
(optarg[0] == '<' && n > ENT_PASS (ent)) ||
|
(optarg[0] == '<' && n > ENT_PASS (ent)) ||
|
||||||
(optarg[0] == '>' && n < ENT_PASS (ent))) &&
|
(optarg[0] == '>' && n < ENT_PASS (ent))) &&
|
||||||
strcmp (ENT_FILE (ent), "none") != 0)
|
strcmp (ENT_FILE (ent), "none") != 0)
|
||||||
{
|
{
|
||||||
printf ("%s\n", ENT_FILE (ent));
|
printf ("%s\n", ENT_FILE (ent));
|
||||||
|
result = EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if ((ent = GET_ENT_FILE (optarg))) {
|
||||||
|
printf ("%d\n", ENT_PASS (ent));
|
||||||
result = EXIT_SUCCESS;
|
result = EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
default:
|
|
||||||
if ((ent = GET_ENT_FILE (optarg))) {
|
|
||||||
printf ("%d\n", ENT_PASS (ent));
|
|
||||||
result = EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
END_ENT;
|
END_ENT;
|
||||||
|
@ -59,7 +59,7 @@ char *rc_xstrdup (const char *str)
|
|||||||
if (! str)
|
if (! str)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
value = rc_xstrdup (str);
|
value = strdup (str);
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
return (value);
|
return (value);
|
||||||
|
Loading…
Reference in New Issue
Block a user