Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Quote all potentially dangerous expansions

  • Loading branch information...
commit 021d276ad08974f45ab034ddc20916c742b210c1 1 parent 4601528
Dave Eddy authored May 25, 2012

Showing 1 changed file with 8 additions and 8 deletions. Show diff stats Hide diff stats

  1. 16  bin/mad
16  bin/mad
@@ -50,8 +50,8 @@ display() {
50 50
   for path in ${path_array[@]}; do
51 51
     local file=$path/$page
52 52
     local ext=$path/$page.md
53  
-    [[ -f "$file" ]] && display_file $file
54  
-    [[ -f "$ext" ]]  && display_file $ext
  53
+    [[ -f "$file" ]] && display_file "$file"
  54
+    [[ -f "$ext" ]]  && display_file "$ext"
55 55
   done
56 56
 
57 57
   echo
@@ -119,10 +119,10 @@ install_all_remote() {
119 119
   echo
120 120
   echo "  ... cloning repo"
121 121
   cd /tmp && rm -fr mad-pages || exit 2
122  
-  if git clone --depth 1 $REMOTE mad-pages && cd mad-pages; then
  122
+  if git clone --depth 1 "$REMOTE" mad-pages && cd mad-pages; then
123 123
     for page in *.md; do
124 124
       echo "  ... installing $page"
125  
-      cp -f $page $path/$page
  125
+      cp -f "$page" "$path/$page"
126 126
     done
127 127
     echo "  ... complete"
128 128
   else
@@ -139,7 +139,7 @@ install_mad() {
139 139
   echo
140 140
   echo "  ... cloning repo"
141 141
   cd /tmp && rm -fr mad || exit 3
142  
-  git clone --depth 1 $REMOTE_MAD mad
  142
+  git clone --depth 1 "$REMOTE_MAD" mad
143 143
   if cd mad && make install; then
144 144
     echo "  ... updated to $(mad --version)"
145 145
   else
@@ -154,9 +154,9 @@ install_mad() {
154 154
 
155 155
 # parse args
156 156
 
157  
-case $1 in
  157
+case "$1" in
158 158
   -v|--version)
159  
-    echo $VERSION
  159
+    echo "$VERSION"
160 160
     ;;
161 161
   -h|--help|help)
162 162
     display_mad_usage
@@ -174,6 +174,6 @@ case $1 in
174 174
     display_from_stdin
175 175
     ;;
176 176
   *)
177  
-    display $1
  177
+    display "$1"
178 178
     ;;
179 179
 esac

0 notes on commit 021d276

Please sign in to comment.
Something went wrong with that request. Please try again.