projects
/
monkeysphere.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8cabd14
)
fix remove_monkeysphere_line function to properly handle empty files.
author
Jameson Graef Rollins
<jrollins@finestructure.net>
Mon, 2 Mar 2009 17:45:48 +0000
(12:45 -0500)
committer
Jameson Graef Rollins
<jrollins@finestructure.net>
Mon, 2 Mar 2009 17:45:48 +0000
(12:45 -0500)
src/share/common
patch
|
blob
|
history
diff --git
a/src/share/common
b/src/share/common
index 83f2d6f0387ce8da484e327349ad09a498c2a9bf..83120d120c785e11cf9ab291852eea3eafe0db84 100644
(file)
--- 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") || \