mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
[HHPCOMP] Check return value when calling chdir (#4073)
Signed-off-by: Sergey Valentei <ihsinme@gmail.com>
This commit is contained in:
parent
51ce0c5150
commit
84ed4a79dc
1 changed files with 5 additions and 1 deletions
|
@ -56,7 +56,11 @@ int main(int argc, char** argv)
|
|||
string absolute_name = replace_backslashes(real_path(argv[1]));
|
||||
int prefixlen = absolute_name.find_last_of('/');
|
||||
clog << prefixlen << endl;
|
||||
chdir(absolute_name.substr(0, prefixlen).c_str()); // change to the project file's directory
|
||||
if (chdir(absolute_name.substr(0, prefixlen).c_str()) == -1) // change to the project file's directory
|
||||
{
|
||||
cerr << "chdir: working directory couldn't be changed" << endl;
|
||||
exit(0);
|
||||
}
|
||||
hhp_reader project_file(absolute_name);
|
||||
|
||||
struct chmcFile chm;
|
||||
|
|
Loading…
Reference in a new issue