summaryrefslogtreecommitdiff
path: root/lib/userspec.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-08-09 18:44:46 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-08-09 18:44:46 +0000
commit8ad3011df39aac9833be500a4c7df7c0186ea733 (patch)
treec14af796e9fa146b2f3289bd5f19bc068616fbbc /lib/userspec.c
parente5f309aaf39d6697d417f78d9e2fecfc14608abb (diff)
downloadcoreutils-8ad3011df39aac9833be500a4c7df7c0186ea733.tar.xz
Remove dependency of xalloc on error, etc.
Diffstat (limited to 'lib/userspec.c')
-rw-r--r--lib/userspec.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/lib/userspec.c b/lib/userspec.c
index 820c71027..6bf40895d 100644
--- a/lib/userspec.c
+++ b/lib/userspec.c
@@ -277,25 +277,10 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
if (error_msg == NULL)
{
if (u != NULL)
- {
- *username_arg = strdup (u);
- if (*username_arg == NULL)
- error_msg = xalloc_msg_memory_exhausted;
- }
+ *username_arg = xstrdup (u);
- if (groupname != NULL && error_msg == NULL)
- {
- *groupname_arg = strdup (groupname);
- if (*groupname_arg == NULL)
- {
- if (*username_arg != NULL)
- {
- free (*username_arg);
- *username_arg = NULL;
- }
- error_msg = xalloc_msg_memory_exhausted;
- }
- }
+ if (groupname != NULL)
+ *groupname_arg = xstrdup (groupname);
}
if (error_msg && dot)