summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/getconf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/posix/getconf.c b/posix/getconf.c
index 5aac25e4ca..bf551bdbb6 100644
--- a/posix/getconf.c
+++ b/posix/getconf.c
@@ -997,12 +997,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
{
char default_name[getconf_dirlen + sizeof "/default"];
memcpy (mempcpy (default_name, getconf_dir, getconf_dirlen),
- "/default", sizeof "/default");
+ "/default", sizeof "/default");
int len = readlink (default_name, buf, sizeof buf - 1);
if (len > 0)
{
buf[len] = '\0';
spec = buf;
+ if (spec[0] == '_')
+ spec++;
}
}
@@ -1036,8 +1038,8 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
size_t spec_len = strlen (spec);
char getconf_name[getconf_dirlen + 2 + spec_len + 1];
memcpy (mempcpy (mempcpy (getconf_name, getconf_dir,
- getconf_dirlen),
- "/_", 2), spec, spec_len + 1);
+ getconf_dirlen),
+ "/_", 2), spec, spec_len + 1);
args[0] = argv0;
args[1] = "-v";
args[2] = spec;