if [ ! -z "`$SEARCHPROG $SEARCHPATH w3m`" ]; then
- echo "mhfixmsg-format-text/html: w3m -dump -T text/html -O utf-8 '%F'" >> $TMP
+ echo 'mhfixmsg-format-text/html: charset="%{charset}"; '"\
+"'w3m -dump -T text/html "${charset:+-I $charset}" -O utf-8 %F' >> $TMP
elif [ ! -z "`$SEARCHPROG $SEARCHPATH lynx`" ]; then
#### lynx indents with 3 spaces, remove them and any trailing spaces.
- echo "mhfixmsg-format-text/html: lynx -child -dump -force_html '%F' | \
+ echo 'mhfixmsg-format-text/html: charset="%{charset}"; '"\
+"'lynx -child -dump -force_html "${charset:+--assume_charset $charset}" %F | '"\
expand | sed -e 's/^ //' -e 's/ *$//'" >> $TMP
elif [ ! -z "`$SEARCHPROG $SEARCHPATH elinks`" ]; then
echo "mhfixmsg-format-text/html: elinks -dump -force-html -no-numbering \
# that another netscape is already running and certain things can't be done).
PGM="`$SEARCHPROG $SEARCHPATH lynx`"
if [ ! -z "$PGM" ]; then
- echo "mhshow-show-text/html: %p$PGM -force-html '%F'" >> $TMP
+ echo 'mhshow-show-text/html: charset="%{charset}"; '"\
+%p$PGM"' -force-html "${charset:+--assume_charset $charset}" %F' >> $TMP
else
PGM="`$SEARCHPROG $SEARCHPATH w3m`"
if [ ! -z "$PGM" ]; then
- echo "mhshow-show-text/html: %p$PGM -T text/html '%F'" >> $TMP
+ echo 'mhshow-show-text/html: charset="%{charset}"; '"\
+%p$PGM"' "${charset:+-I $charset}" -T text/html %F' >> $TMP
fi
fi
setup_test
-#### Use ap from PATH.
-PATH=`mhparam libdir`:$PATH
-
if test "$ICONV_ENABLED" -eq 0; then
test_skip 'test-textcharset requires that nmh have been built with iconv'
fi
grep -v 'mhshow-show-text/plain:' "$MH" >"$MH.new"
mv -f "$MH.new" "$MH"
cat >>"$MH" <<'EOF'
-mhshow-show-text/plain: echo `ap -format '%(void(lit %{charset}))%<(nonnull)-I %(putstr)%>' 0`
+mhshow-show-text/plain: charset="%{charset}"; echo ${charset:+-I $charset}
EOF
# check expansion of embedded %{charset} with no text following
{
pid_t child_id;
int i;
- char *vec[4], exec[BUFSIZ + sizeof "exec "];
+ char *vec[4];
if (debugsw || cracked) {
fflush (stdout);
}
}
- snprintf (exec, sizeof(exec), "exec %s", buffer);
-
vec[0] = "/bin/sh";
vec[1] = "-c";
- vec[2] = exec;
+ vec[2] = buffer;
vec[3] = NULL;
fflush (stdout);
just increment by 1 for the '{'. */
cp += strlen(param) + 1;
- /* cp points to the param and it's set in the
+ /* cp pointed to the param and it's set in the
Content-Type header. */
strncpy (bp, value, buflen);
+
+ /* since we've quoted the file argument, set things up
+ * to look past it, to avoid problems with the quoting
+ * logic below. (I know, I should figure out what's
+ * broken with the quoting logic, but..)
+ */
+ len = strlen(bp);
+ buflen -= len;
+ bp += len;
+ pp = bp;
+
break;
} else if (found == 1) {
/* cp points to the param and it's not set in the
*bp++ = '{';
*bp = '\0';
buflen -= 2;
- break;
+ continue;
}
/* No parameter was found, so fall thru to default to