summaryrefslogtreecommitdiffstats
path: root/lib/exec_shell.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
commitc61e14d3a8412cd50d98aab604e607692c844c8a (patch)
tree4925aca0e6b64c8664ea2f3fdfa99a52dc93d5da /lib/exec_shell.c
parentAdding upstream version 2.39.3. (diff)
downloadutil-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.tar.xz
util-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.zip
Adding upstream version 2.40.upstream/2.40
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/exec_shell.c')
-rw-r--r--lib/exec_shell.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/exec_shell.c b/lib/exec_shell.c
index 6fef6c7..96d3e95 100644
--- a/lib/exec_shell.c
+++ b/lib/exec_shell.c
@@ -42,9 +42,7 @@ void __attribute__((__noreturn__)) exec_shell(void)
shellc = xstrdup(shell);
shell_basename = basename(shellc);
- arg0 = xmalloc(strlen(shell_basename) + 2);
- arg0[0] = '-';
- strcpy(arg0 + 1, shell_basename);
+ xasprintf(&arg0, "-%s", shell_basename);
execl(shell, arg0, (char *)NULL);
errexec(shell);