Check the return status of chdir() when using the -C option.
Reviewed by: bright && jmallet MFC after: 1 day
This commit is contained in:
parent
1aa83d38bc
commit
85994822df
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107964
@ -159,7 +159,8 @@ MainParseArgs(int argc, char **argv)
|
||||
rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
|
||||
switch(c) {
|
||||
case 'C':
|
||||
chdir(optarg);
|
||||
if (chdir(optarg) == -1)
|
||||
err(1, "chdir %s", optarg);
|
||||
break;
|
||||
case 'D':
|
||||
Var_Set(optarg, "1", VAR_GLOBAL);
|
||||
|
Loading…
Reference in New Issue
Block a user