aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2006-10-05 00:21:15 +0000
committerNed Ludd <solar@gentoo.org>2006-10-05 00:21:15 +0000
commit900920fc0babd3ee8bd90af7577883aeb31cbaf5 (patch)
tree91d481460842af75fbdd6e21624831056ef06751 /pspax.c
parent- commit partial -u/-g support for user and group names vs just numeric uid/g... (diff)
downloadpax-utils-900920fc0babd3ee8bd90af7577883aeb31cbaf5.tar.gz
pax-utils-900920fc0babd3ee8bd90af7577883aeb31cbaf5.tar.bz2
pax-utils-900920fc0babd3ee8bd90af7577883aeb31cbaf5.zip
- fix -u/-g 0 a little
Diffstat (limited to 'pspax.c')
-rw-r--r--pspax.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pspax.c b/pspax.c
index 230dcaa..be60338 100644
--- a/pspax.c
+++ b/pspax.c
@@ -25,7 +25,7 @@
#endif
#define PROC_DIR "/proc"
-static const char *rcsid = "$Id: pspax.c,v 1.32 2006/10/04 23:42:47 solar Exp $";
+static const char *rcsid = "$Id: pspax.c,v 1.33 2006/10/05 00:21:15 solar Exp $";
#define argv0 "pspax"
@@ -443,7 +443,7 @@ static void parseargs(int argc, char *argv[])
case 'v': verbose++; break;
case 'u':
show_uid = atoi(optarg);
- if (show_uid == 0) {
+ if (show_uid == 0 && (strcmp(optarg, "0") != 0)) {
pwd = getpwnam(optarg);
if (pwd)
show_uid = pwd->pw_uid;
@@ -453,7 +453,7 @@ static void parseargs(int argc, char *argv[])
break;
case 'g':
show_gid = atoi(optarg);
- if (show_gid == 0) {
+ if (show_gid == 0 && (strcmp(optarg, "0") != 0)) {
gwd = getgrnam(optarg);
if (gwd)
show_gid = gwd->gr_gid;