In tests %s is not substituted with filename

Bug #1795907 reported by Alexander Lazarević
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mime-support (Ubuntu)
New
Undecided
Unassigned

Bug Description

The manual of mailcap(5) says that in the test field "The command may be any UNIX command, using the same syntax and the same %-escapes as for the viewing command"

So this mailcap entry should be fine:

text/plain; wc '%s'; test=grep -q somepattern %s

I would expect to whenever there's a plain text file that contains the word somepattern, wc should be invoked by run-mailcap on it. Otherwise this entry should not be considered by run-mailcap.

What actually happens is that the %s will be substituted for the view field (wc '%s') but not for the test field and so this entry will be never considered.

I've included a bash script with testcases to demonstrate the bug. (Please keep in mind that after all the years I still do consider myself a bash script novice)

I have no patch. I do not grok perl.

Tags: testcase
Revision history for this message
Alexander Lazarević (e11bits) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.