From bc914c949f09e7e8858913ec9635fc56c8a87375 Mon Sep 17 00:00:00 2001 From: Jason Yu Date: Thu, 13 Oct 2022 15:53:14 +0800 Subject: [PATCH] sim,sim-se: Fixes the bug of missing "/" in path resolution The syscall emulation did not correctly handle the scenario where the base path does not end with "/". The "/" should be appended first before the file name is appended. This commit fixes this bug. Change-Id: I9a9b38d1885e46b2a0e42018fd7d68010c70133c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64471 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Bobby Bruce --- src/sim/process.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sim/process.cc b/src/sim/process.cc index 97130bd9d3..a348b450b0 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -520,7 +520,7 @@ Process::absolutePath(const std::string &filename, bool host_filesystem) } // Add a trailing '/' if the current working directory did not have one. - normalize(path_base); + path_base = normalize(path_base); // Append the filename onto the current working path. auto absolute_path = path_base + filename;