diff options
-rw-r--r-- | usr.bin/mg/def.h | 3 | ||||
-rw-r--r-- | usr.bin/mg/dired.c | 4 | ||||
-rw-r--r-- | usr.bin/mg/file.c | 4 | ||||
-rw-r--r-- | usr.bin/mg/main.c | 6 |
4 files changed, 10 insertions, 7 deletions
diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h index 22f099d89e6..01747539847 100644 --- a/usr.bin/mg/def.h +++ b/usr.bin/mg/def.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.h,v 1.151 2015/10/12 19:08:39 lum Exp $ */ +/* $OpenBSD: def.h,v 1.152 2015/10/29 19:46:47 lum Exp $ */ /* This file is in the public domain. */ @@ -360,6 +360,7 @@ int ask_makedir(void); /* dired.c */ struct buffer *dired_(char *); +int do_dired(char *); /* file.c X */ int fileinsert(int, int); diff --git a/usr.bin/mg/dired.c b/usr.bin/mg/dired.c index 36413649602..b17186e8934 100644 --- a/usr.bin/mg/dired.c +++ b/usr.bin/mg/dired.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dired.c,v 1.79 2015/10/13 20:10:09 lum Exp $ */ +/* $OpenBSD: dired.c,v 1.80 2015/10/29 19:46:47 lum Exp $ */ /* This file is in the public domain. */ @@ -865,7 +865,7 @@ dired_(char *dname) if ((access(dname, R_OK | X_OK)) == -1) { if (errno == EACCES) { dobeep(); - ewprintf("Permission denied"); + ewprintf("Permission denied: %s", dname); } return (NULL); } diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c index 820b55127e7..27b379de43c 100644 --- a/usr.bin/mg/file.c +++ b/usr.bin/mg/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.98 2015/09/29 08:53:53 lum Exp $ */ +/* $OpenBSD: file.c,v 1.99 2015/10/29 19:46:47 lum Exp $ */ /* This file is in the public domain. */ @@ -20,8 +20,6 @@ size_t xdirname(char *, const char *, size_t); -static int do_dired(char *); - /* * Insert a file into the current buffer. Real easy - just call the * insertfile routine with the file name. diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c index 52fb39e81ba..ed89cbf2ae4 100644 --- a/usr.bin/mg/main.c +++ b/usr.bin/mg/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.75 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: main.c,v 1.76 2015/10/29 19:46:47 lum Exp $ */ /* This file is in the public domain. */ @@ -150,6 +150,10 @@ notnum: if (nfiles == 1) splitwind(0, 1); + if (fisdir(cp) == TRUE) { + (void)do_dired(cp); + continue; + } if ((curbp = findbuffer(cp)) == NULL) { vttidy(); errx(1, "Can't find current buffer!"); |