From e2b2a4831be5f682a5a59b642fde1ba1f1caa308 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 12 Apr 2011 23:33:31 -0400 Subject: Match form field types exactly --- examples/data/scripts/formfiller.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/data') diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index 3dc9dc4..435a114 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -66,15 +66,15 @@ ParseFields () field = $0 sub ( /[^:]*:/, "", field ) - if ( parts[2] ~ /(text|password|search)/ ) + if ( parts[2] ~ /^(text|password|search)$/ ) printf( "js uzbl.formfiller.insert(\"%s\",\"%s\",\"%s\",0);\n", parts[1], parts[2], field ) - else if ( parts[2] ~ /(checkbox|radio)/ ) + else if ( parts[2] ~ /^(checkbox|radio)$/ ) printf( "js uzbl.formfiller.insert(\"%s\",\"%s\",\"%s\",%s);\n", parts[1], parts[2], parts[3], field ) - else if ( parts[2] == "textarea" ) { + else if ( parts[2] ~ /^textarea$/ ) { field = "" while (getline) { if ( /^%/ ) break -- cgit v1.2.3 From e1bb5b44c16636b4ffc1cc14dbe1e23c0b0e63de Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 12 Apr 2011 23:33:46 -0400 Subject: Properly escape newlines --- examples/data/scripts/formfiller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/data') diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index 435a114..14853c7 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -81,7 +81,7 @@ ParseFields () sub ( /^\\/, "" ) gsub ( /"/, "\\\"" ) gsub ( /\\/, "\\\\" ) - field = field $0 "\\n" + field = field $0 "\\\\n" } printf( "js uzbl.formfiller.insert(\"%s\",\"%s\",\"%s\",0);\n", parts[1], parts[2], field ) -- cgit v1.2.3 From 1a7bfc9471fcc46135b1099629675f085af7407a Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 12 Apr 2011 23:45:27 -0400 Subject: Fix sed typo --- examples/data/scripts/formfiller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/data') diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index 14853c7..b69ab60 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -132,7 +132,7 @@ Once () test -e "$tmpfile" && ParseFields < "$tmpfile" \ - | sed 's/@/\\@' \ + | sed 's/@/\\@/' \ > "$UZBL_FIFO" } -- cgit v1.2.3 From d5b71e85e1b13c79a6de488254406ec690c9efe7 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 12 Apr 2011 23:58:48 -0400 Subject: Escape all @ characters --- examples/data/scripts/formfiller.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/data') diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index b69ab60..c1171a0 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -116,7 +116,7 @@ Load () ParseProfile $option < "$file" \ | ParseFields \ - | sed 's/@/\\@/' \ + | sed 's/@/\\@/g' \ > "$UZBL_FIFO" } @@ -132,7 +132,7 @@ Once () test -e "$tmpfile" && ParseFields < "$tmpfile" \ - | sed 's/@/\\@/' \ + | sed 's/@/\\@/g' \ > "$UZBL_FIFO" } -- cgit v1.2.3