From 7309686ac2456331cb0e5c54c1f4ceac996ba549 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 25 Apr 2019 18:17:34 -0400 Subject: dir_is_empty(): Move shift and remove duplicate pattern Also update copyright notice. --- (limited to 'src/dir.sh') diff --git a/src/dir.sh b/src/dir.sh index ac7fef0..c04aa55 100644 --- a/src/dir.sh +++ b/src/dir.sh @@ -1,6 +1,6 @@ # Miscellaneous directory-related functions # -# Copyright (C) 2013, 2014 Patrick "P. J." McDermott +# Copyright (C) 2013, 2014 Patrick McDermott # # This file is part of the ProteanOS Development Kit. # @@ -21,11 +21,11 @@ dir_is_empty() { local dir="${1}" + shift 1 local ret= local dirent= local exclude= local exclusion= - shift 1 ret=0 @@ -35,7 +35,7 @@ dir_is_empty() # and aren't ".." # .??* dirents whose names start with "." and are three or more # characters long - for dirent in "${dir}/"* "${dir}/".[!.] "${dir}/".[!.] "${dir}/".??*; do + for dirent in "${dir}/"* "${dir}/".[!.] "${dir}/".??*; do if ! [ -e "${dirent}" ]; then continue fi -- cgit v0.9.1