=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/dir.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- src/usr.bin/mg/dir.c 2014/03/31 18:00:58 1.26 +++ src/usr.bin/mg/dir.c 2014/04/03 20:17:12 1.27 @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.26 2014/03/31 18:00:58 lum Exp $ */ +/* $OpenBSD: dir.c,v 1.27 2014/04/03 20:17:12 lum Exp $ */ /* This file is in the public domain. */ @@ -84,18 +84,15 @@ int makedir(int f, int n) { - return (do_makedir()); + return (ask_makedir()); } int -do_makedir(void) +ask_makedir(void) { - struct stat sb; - int finished, ishere; - mode_t dir_mode, mode, oumask; char bufc[NFILEN]; - char *slash, *path; + char *path; if (getbufcwd(bufc, sizeof(bufc)) != TRUE) return (ABORT); @@ -104,6 +101,17 @@ return (ABORT); else if (path[0] == '\0') return (FALSE); + + return (do_makedir(path)); +} + +int +do_makedir(char *path) +{ + struct stat sb; + int finished, ishere; + mode_t dir_mode, mode, oumask; + char *slash; if ((path = adjustname(path, TRUE)) == NULL) return (FALSE);