summaryrefslogtreecommitdiff
path: root/usr.bin/mg/file.c
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2010-06-26 16:18:45 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2010-06-26 16:18:45 +0000
commit655a24356fe84ac3e110431aaaa1f8ba3deb6cf4 (patch)
tree56146cc118e8e2e970c7e68d170bee3bbcc9c326 /usr.bin/mg/file.c
parent3d11d69fe7cd386923ba3ef27c5f69e938111ff6 (diff)
From the Loganaden Velvindron:
Make dired more sane (and emacslike): * Position cursor at first filename after .. * Don't reposition cursor on reopening * Check for permission before attempting to open directory I took forever to get this in. Thanks, Logan for being patient!
Diffstat (limited to 'usr.bin/mg/file.c')
-rw-r--r--usr.bin/mg/file.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c
index ee345924c75..be98250def5 100644
--- a/usr.bin/mg/file.c
+++ b/usr.bin/mg/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.71 2009/06/04 23:39:37 kjell Exp $ */
+/* $OpenBSD: file.c,v 1.72 2010/06/26 16:18:44 kjell Exp $ */
/* This file is in the public domain. */
@@ -220,10 +220,12 @@ readin(char *fname)
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) {
if (wp->w_bufp == curbp) {
- wp->w_dotp = wp->w_linep = bfirstlp(curbp);
- wp->w_doto = 0;
- wp->w_markp = NULL;
- wp->w_marko = 0;
+ if ((fisdir(fname)) != TRUE) {
+ wp->w_dotp = wp->w_linep = bfirstlp(curbp);
+ wp->w_doto = 0;
+ wp->w_markp = NULL;
+ wp->w_marko = 0;
+ }
}
}