changeset 612:e3a675c53f55

Do not open existing directory in /sudo::
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Tue, 19 Jan 2016 13:49:37 +0200
parents 256d506d8601
children 689807b5ad8f
files emacs/e
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/emacs/e	Mon Jan 18 01:26:58 2016 +0200
+++ b/emacs/e	Tue Jan 19 13:49:37 2016 +0200
@@ -31,7 +31,7 @@
 
 f=`readlink -f "$1"`
 d="${f%/*}"
-if [ -e "$f" ] && [ ! -w "$f" ] || [ -e "$d" ] && [ ! -w "$d" ]; then
+if [ '(' -f "$f" -a ! -w "$f" ')' -o '(' ! -e "$f" -a -e "$d" -a ! -w "$d" ')' ]; then
     shift
     exec emacsclient $args -- "/sudo::$f" "$@"
 fi