[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: accept_media=*/*, wildcard/shell problem?



In [emacs-w3m:13830]
On Mon, 16 Aug 2021 02:44:40 +0200, Emanuel Berg wrote:
> Katsumi Yamaoka wrote:
>> Zsh seems to try to expand the wild cards "*/*" always, so
>> I've changed the shell used in the `w3m-download' to be
>> hard-coded with "sh".

> OK, but should zsh do that, you think?

Yes, the error is exactly what zsh issues, I confirmed.
Here what `w3m-download' does then is:

"/bin/zsh" "-c" "/usr/local/bin/w3m -o accept_language=ja,en -dump_extra -o accept_media=*/* https://www.nifty-networks.net/swirc/releases/swirc-3.3.0.tgz| awk -v BINMODE=3 'BEGIN{Body=0; Line=\"\"}(Body==0)&&(Line!=$0){Line=$0; print $0}(Body==1){printf \"%s%s\",$0,RT>\"~/Downloads/swirc-3.3.0.tgz\"}/^$/{Body=1} END{printf \"\">>\"~/Downloads/swirc-3.3.0.tgz\"}'"

I.e., zsh tries to expand "*/*" before executing w3m and failes.
Quoting "*/*" as the following does help:

::: w3m.el :::
    ;; Enable w3m to download any kinds of contents.
    ,@(unless (eq w3m-type 'w3mmee)
-       '("-o" "accept_media=*/*"))
+       '("-o" "'accept_media=*/*'"))
    ,url)

However, I thought it does not necessarily mean the succeeding
gawk script to be passed to zsh correctly.  This is why I hard-
coded the shell name.

Regards,