Skip to content

Commit

Permalink
Fixed error messege if p flag
Browse files Browse the repository at this point in the history
  • Loading branch information
proh14 committed Apr 22, 2024
1 parent 61c1d73 commit 3202ec2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mkdir/mkdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int str_to_mode(const char *str, mode_t *mode) {

static void make_dir(const char *path) {
if (mkdir(path, mode) == -1) {
if (!pflag) {
if (!pflag || (errno != ENOENT && pflag)) {
fprintf(stderr, "mkdir: cannot create directory '%s': %s \n", path,
strerror(errno));
}
Expand Down

0 comments on commit 3202ec2

Please sign in to comment.