mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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)))
|
if (!(cwd = getcwd(NULL, 0)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if ((strlen(cwd) > strlen(".../commanddata")) &&
|
if ((display = strstr(cwd, "/commanddata")) &&
|
||||||
(STREQ(cwd + strlen(cwd) - strlen("/commanddata"), "/commanddata"))) {
|
STREQ(display, "/commanddata")) {
|
||||||
strcpy(cwd, ".../commanddata");
|
fprintf(log, "CWD:.../commanddata\n");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
display = cwd;
|
display = cwd;
|
||||||
|
Loading…
Reference in New Issue
Block a user