Message ID | 20230710125031.0e140727@gandalf.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | 9b16b3b3be66e2ee887450f17f3fbab556733bfe |
Headers | show |
Series | trace-cmd split: Fix creation of temp files to include output name | expand |
diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c index 59df1d02b345..4fda781307e6 100644 --- a/tracecmd/trace-split.c +++ b/tracecmd/trace-split.c @@ -367,8 +367,9 @@ static double parse_file(struct tracecmd_input *handle, int fd; output = strdup(output_file); - dir = dirname(output); + /* Extract basename() first, as dirname() truncates output */ base = basename(output); + dir = dirname(output); ohandle = tracecmd_copy(handle, output_file, TRACECMD_FILE_CMD_LINES, 0, NULL);