mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
commandhelper: printCwd: Print result directly instead of copying it
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
4851a99ee0
commit
479f92ae16
@ -221,9 +221,10 @@ static int printCwd(FILE *log)
|
||||
if (!(cwd = getcwd(NULL, 0)))
|
||||
return -1;
|
||||
|
||||
if ((strlen(cwd) > strlen(".../commanddata")) &&
|
||||
(STREQ(cwd + strlen(cwd) - strlen("/commanddata"), "/commanddata"))) {
|
||||
strcpy(cwd, ".../commanddata");
|
||||
if ((display = strstr(cwd, "/commanddata")) &&
|
||||
STREQ(display, "/commanddata")) {
|
||||
fprintf(log, "CWD:.../commanddata\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
display = cwd;
|
||||
|
Loading…
Reference in New Issue
Block a user