Fix get-bug-attachments script.
authorMorgan Deters <mdeters@cs.nyu.edu>
Wed, 5 Nov 2014 16:41:05 +0000 (17:41 +0100)
committerMorgan Deters <mdeters@cs.nyu.edu>
Wed, 5 Nov 2014 16:41:05 +0000 (17:41 +0100)
contrib/get-bug-attachments

index 869eee895ef20b3a294efbee6b2540d0f661965a..80205bafff05b7c42afde670916684325599ccd4 100755 (executable)
@@ -29,7 +29,7 @@ function webcat {
 function webget {
   if which wget &>/dev/null; then
     tmpfile="$(mktemp get_bug_attach.$$.XXXXXXXX)"
-    filename="$(wget -qS -O "$tmpfile" "$1" 2>&1 | grep 'Content-disposition: attachment' | sed 's,.*filename="\(.*\)".*,\1,')"
+    filename="$(wget -qS -O "$tmpfile" "$1" 2>&1 | grep -i 'Content-disposition: attachment' | sed 's,.*filename="\(.*\)".*,\1,')"
     ext="$(echo "$filename" | sed 's,.*\.\(.*\),\1,')"
     if [ -e "$2.$ext" ] && ! diff -q "$tmpfile" "$2.$ext" &>/dev/null; then
       c=a
@@ -46,7 +46,7 @@ function webget {
     fi
   elif which curl &>/dev/null; then
     tmpfile="$(mktemp get_bug_attach.$$.XXXXXXXX)"
-    filename="$(curl --head "$1" 2>&1 | grep 'Content-disposition: attachment' | sed 's,.*filename="\(.*\)".*,\1,')"
+    filename="$(curl --head "$1" 2>&1 | grep -i 'Content-disposition: attachment' | sed 's,.*filename="\(.*\)".*,\1,')"
     curl "$1" >"$tmpfile" 2>/dev/null
     ext="$(echo "$filename" | sed 's,.*\.\(.*\),\1,')"
     if [ -e "$2.$ext" ] && ! diff -q "$tmpfile" "$2.$ext" &>/dev/null; then