summaryrefslogtreecommitdiff
path: root/src/share/common
diff options
context:
space:
mode:
authorJameson Graef Rollins <jrollins@finestructure.net>2009-03-02 12:45:48 -0500
committerJameson Graef Rollins <jrollins@finestructure.net>2009-03-02 12:45:48 -0500
commitbd5aac0e2eae2dd73c35b6bbb2e79ef48c98ca21 (patch)
treec0e5efb0d9546458212cb05a6c6f7ee746b22264 /src/share/common
parent8cabd14f454708cdb0310d77e4897e860fc87ecc (diff)
fix remove_monkeysphere_line function to properly handle empty files.
Diffstat (limited to 'src/share/common')
-rw-r--r--src/share/common9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/share/common b/src/share/common
index 83f2d6f..83120d1 100644
--- a/src/share/common
+++ b/src/share/common
@@ -354,12 +354,15 @@ remove_monkeysphere_lines() {
file="$1"
- if [ -z "$file" ] ; then
+ # return error if file does not exist
+ if [ ! -e "$file" ] ; then
return 1
fi
- if [ ! -e "$file" ] ; then
- return 1
+ # just return ok if the file is empty, since there aren't any
+ # lines to remove
+ if [ ! -s "$file" ] ; then
+ return 0
fi
tempfile=$(mktemp "${file}.XXXXXXX") || \