[Lunar-commits] <lunar> lrm: test -d returns true for symlinked folders, so check for them

Michael 'v4hn' Goerner v4hn at lunar-linux.org
Mon Aug 13 14:54:39 CEST 2012


commit bb0b364fc6d0d143c911b1ca21bb2662bac18b15
Author: Michael 'v4hn' Goerner <v4hn at lunar-linux.org>
Date: Mon, 13 Aug 2012 05:54:39 -0700
URL: https://github.com/lunar-linux/lunar/commit/bb0b364fc6d0d143c911b1ca21bb2662bac18b15

lrm: test -d returns true for symlinked folders, so check for them
---
  prog/lrm                                                     +1/-1     
  1 files changed, 1 insertions (+), 1 deletions (-)

--- a/prog/lrm
+++ b/prog/lrm
@@ -101,7 +101,7 @@ remove_something() {
     return 1
   fi
 
-  if [ -d "$1" ] ; then
+  if [ -d "$1" ] && ! [ -L "$1" ]; then
     if rmdir "$1" 2> /dev/null ; then
       debug_msg "ok    : rmdir \"$1\""
     else




More information about the Lunar-commits mailing list