@@ -92,13 +92,14 @@ readonly 'EX_CONFIG=78' # configuration error
9292
9393readonly ' EX__MAX=78' # maximum listed value
9494
95- trap ' case "${?}" in 0) endCall ;; *) endCall "${EX_SOFTWARE}";; esac' 0 # EXIT
96- trap ' endCall 129' 1 # SIGHUP
97- trap ' endCall 130' 2 # SIGINT
98- trap ' endCall 131' 3 # SIGQUIT
99- trap ' endCall 143' 15 # SIGTERM
95+ trap ' case "${?}" in 0) end_call ;; *) end_call "${EX_SOFTWARE}";; esac' 0 # EXIT
96+ trap ' end_call 129' 1 # SIGHUP
97+ trap ' end_call 130' 2 # SIGINT
98+ trap ' end_call 131' 3 # SIGQUIT
99+ trap ' end_call 143' 15 # SIGTERM
100100
101- endCall () {
101+
102+ end_call () {
102103 trap ' ' 0 # EXIT
103104 rm -fr -- ${tmpDir: +" ${tmpDir} " }
104105 exit " ${1:- 0} "
@@ -128,7 +129,6 @@ singlequote_escape() {
128129
129130
130131
131-
132132abspath () {
133133 case " ${2} " in
134134 ' /' * ) set -- " ${1} " " ${2} /" ' ' ;;
@@ -146,6 +146,7 @@ abspath() {
146146 eval " ${1} =\" /\$ {3#/}\" "
147147}
148148
149+
149150path_to_fileurl () {
150151 abspath " ${1} " " ${2} "
151152
@@ -338,15 +339,15 @@ add_printtmp() {
338339}
339340
340341error_meesage () {
341- httpresponse --status-line ' HTTP/1.1 500 Internal Server Error' -H ' Content-Type: text/plain; charset=UTF-8' -- - << -EOF
342+ httpresponse --status-line ' HTTP/1.1 500 Internal Server Error' -H ' Content-Type: text/plain; charset=UTF-8' -- - << -__EOF__
342343 An unexpected error occurred during request processing.
343344
344345
345346 $( cat -- ${@ +" ${@ } " } )
346347
347348
348349 $( env)
349- EOF
350+ __EOF__
350351}
351352
352353expand () {
@@ -373,12 +374,12 @@ case "${W3MPLUS_DEBUGMODE}" in
373374 0)
374375 exec 1>&3 2>&4 3>&- 4>&-
375376 cat -- "${tmpDir}/stdout"
376- endCall 0
377+ end_call 0
377378 ;;
378379 *)
379380 exec 1>&3 2>&4 3>&- 4>&-
380381 error_meesage "${tmpDir}/stderr"
381- endCall "${EX_SOFTWARE}"
382+ end_call "${EX_SOFTWARE}"
382383 ;;
383384 esac
384385 ' 0 # EXIT
@@ -398,9 +399,9 @@ if [ -f "${W3MPLUS_PASS_FILE}" ] && [ "${W3MPLUS_PASS_VALUE}" '!=' "$(cat -- "${
398399 httpresponse \
399400 --status-line ' HTTP/1.1 400 Bad Request' \
400401 -H ' Content-Type: text/plain; charset=UTF-8' \
401- -- - << -'EOF '
402+ -- - << -'__EOF__ '
402403 The value of 'pass' is invalid.
403- EOF
404+ __EOF__
404405
405406 exit
406407fi
@@ -496,9 +497,9 @@ case "${query_action-}" in
496497
497498 query_subaction=' goto'
498499 commandArg=" ${commandArg} $(
499- cat << -'EOF '
500+ cat << -'__EOF__ '
500501 -- incrementuri ${query_number+--number "'${query_number}'"}
501- EOF
502+ __EOF__
502503 ) "
503504 ;;
504505 ' parent-uripath' )
@@ -508,9 +509,9 @@ case "${query_action-}" in
508509
509510 query_subaction=' goto'
510511 commandArg=" ${commandArg} $(
511- cat << -'EOF '
512+ cat << -'__EOF__ '
512513 -- parenturipath ${query_number+--number "'${query_number}'"}
513- EOF
514+ __EOF__
514515 ) "
515516 ;;
516517 ' redirect' )
@@ -522,9 +523,9 @@ case "${query_action-}" in
522523 pass=$( printf ' %s' " ${W3MPLUS_PASS_VALUE} " | urlencode)
523524 path_to_fileurl ' filepath' " ${SCRIPT_NAME} "
524525 commandArg=" ${commandArg} $(
525- cat << -'EOF '
526+ cat << -'__EOF__ '
526527 -- printf "'%s%s'" "'${query_redirect-${filepath}?pass=${pass}&action=search&tab=del-prebuf&query=}'" '"$(urlencode)"'
527- EOF
528+ __EOF__
528529 ) "
529530 ;;
530531 esac
@@ -594,7 +595,7 @@ case "${query_action-}" in
594595 ;;
595596' get-url-mark' | ' get-url-mark-line-begin' )
596597 awkScript=$(
597- cat << -'EOF '
598+ cat << -'__EOF__ '
598599 BEGIN {
599600 FS = "\t"
600601 }
@@ -605,7 +606,7 @@ case "${query_action-}" in
605606
606607 printf("%s\t%s\t\t\t%s\n", uri, line, (moveURL == "" ? "" : "GOTO " moveURL $3))
607608 }
608- EOF
609+ __EOF__
609610 )
610611
611612 case " ${query_action} " in
@@ -871,7 +872,7 @@ case "${query_action-}" in
871872 ;;
872873' show-search-history' )
873874 awkScript=$(
874- cat << -'EOF '
875+ cat << -'__EOF__ '
875876
876877
877878
@@ -1060,7 +1061,7 @@ case "${query_action-}" in
10601061 END {
10611062 printf("</samp></pre>")
10621063 }
1063- EOF
1064+ __EOF__
10641065 )
10651066 pass=$( printf ' %s' " ${W3MPLUS_PASS_VALUE} " | urlencode)
10661067 path_to_fileurl ' filepath' " ${SCRIPT_NAME} "
@@ -1218,7 +1219,7 @@ case "${query_action-}" in
12181219
12191220 printhtml \
12201221 --title ' Bad Request' \
1221- -- - << -EOF |
1222+ -- - << -__EOF__ |
12221223 <dl>
12231224 <dt>about-uri</dt>
12241225 <dd>${filepath} ?pass={PASS_VALUE}&action=about-uri&about={ABOUT_URI}</dd>
@@ -1352,7 +1353,7 @@ case "${query_action-}" in
13521353 <dt>zoom</dt>
13531354 <dd>${filepath} ?pass={PASS_VALUE}&action=zoom&zoom={([+*/-] '=')? UNSIGNED_INTEGER}</dd>
13541355 </dl>
1355- EOF
1356+ __EOF__
13561357 httpresponse \
13571358 --status-line ' HTTP/1.1 400 Bad Request' \
13581359 -H ' Content-Type: text/html; charset=UTF-8' \
0 commit comments