Age | Commit message (Collapse) | Author |
|
The mutt_rfc1524_expand_filename() function calls mutt_adv_mktemp(),
which also calls the sanitizer.
However, if the recv-mode suggested filename has a slash, it's better
to sanitize before calling expand_filename() too, to preserve the
entire filename (albeit with the slashes sanitized out).
For example (ignoring name templates) if the file were called
"either/or.pdf", pre-sanitizing would generate "either_or.pdf", while
not doing so would generate "or.pdf".
|
|
This will allow "view" mailcap invocations and autoview invocations to
display something reasonable for international file names. Also add
the flag to mutt_adv_mktemp(), which the mailcap viewer calls.
Convert the 'slash parameter' to an ALLOW_SLASH flag. This makes the
flags consistent (both "allow" something not permitted by default),
and invocations more readable.
|
|
This uses a copiousoutput mailcap entry, or falls back to raw text.
The existing functions do not provide a way to use copiousoutput
mailcap entries exclusively. The default <view-attach> will use one
for internally supported types if auto_view is configured, but there
is no way to do so for other mime types (such as application/pdf).
|
|
Several of the cases are covered by the pipe fixes in the last commit.
The last case is similar to the mutt_view_attachment case. Since the
send-mode file might be modified, change it to always save to a
tempfile and then unstuff the tempfile.
|
|
The pipe routines are not used in other places (except printing
attachments - to be handled next), so just directly modify them.
Take care to space-stuff the filter output, since it replaces the
space-stuffed compose part.
|
|
This is used in receive mode for <view-text> and <view-mailcap>.
I don't think those are accessible from the compose menu, but the code
allows it. So fix up the send-case too.
Since we may need to unstuff the send-mode file, make a copy instead
of symlinking. Also clean up the code to just sanitize the filename
regardless.
|
|
Because of mime_lookup commands, the call to mutt_check_lookup_list()
inside the function can modify the passed in type. Add an explicit
length parameter to the function, rather than assume the parameter
size. This also makes it more evident the type parameter can be
modified to callers.
Change the len parameter to mutt_check_lookup_list() to type size_t,
just to be correct about it.
|
|
|
|
The existing code was fine, but make it robust like other free
functions in mutt, so the behavior isn't surprising.
|
|
Check if mutt_save_attachment() fails and abort the print in that
case.
|
|
The return value was of dubious value. It returned 0 only for the
case that a nametemplate was specified and it already matched the
supplied oldfile.
However, just because the nametemplate matched does not mean
attachment handling in send-mode should skip the mutt_adv_mktemp()
conversion, which includes a call to mutt_sanitize_filename(). We
didn't do so if *no* nametemplate was supplied.
Remove the return value from the function, and remove the checks and
"special handing" in attach.c calls.
|
|
mutt_rfc1524_expand_filename() runs the result through
mutt_adv_mktemp(), which will sanitize and relocate the filename under
$tmpdir. The strcmp() is unneeded and distracting to the program
logic; none of the other routines perform or need this check.
|
|
In the case where safe_symlink() fail, mutt prompts to continue, but
did not properly reset the filename to be operated on.
Fix up mutt_view_attachment() to use the same flow as the others, to
allow for easier comparison.
|
|
It will return this when a nametemplate entry already matched the
passed in filename. So this bug required both a print entry and an
already matching nametemplate entry to trigger.
|
|
Remove buffer prefix now that all callers are converted.
|
|
Remove buffer prefix since all callers now use this version.
|
|
Now that all callers pass a BUFFER, the buffer prefix is not needed to
distinguish the parameter.
|
|
These are mostly the result of making the formatting changes commit
after the indent changes commit.
|
|
Add spaces after if, else, while, for, switch.
Unify the brace placement style. The vast majority of the code uses
Allman style so convert the relatively few K&R braces over.
|
|
These are mostly automated changes corresponding to the emacs
settings:
(c-set-style "linux")
(setq c-basic-offset 2)
(c-set-offset 'case-label '+)
Most of the code follows the convention:
(add-to-list 'c-cleanup-list 'space-before-funcall)
but this is not enforced by this indentation cleanup.
Also, I personally dislike tabs, so I have:
(setq-default indent-tabs-mode nil)
in my own configuration. However I have no desire to change every line
just for that effect. So this cleanup does nothing about the mix issue.
Some of the secondary files (e.g. regex.c) have been skipped.
I've also skipped crypt-gpgme.c, because I need to think about that
file. Werner Koch and the GnuPG team contributed most it, and it
follows the Gnu indentation settings. It should probably be made
uniform with Mutt, but I don't want to discourage future GnuPG
contribution to the file.
I manually reverted a few unsightly cleanups, and added a few tweeks
when I saw things that could be improved.
|
|
The result of
find . -name "*.[ch]" -exec emacs -batch {} \
--eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
|
|
Converting a return to a rc assignment accidentally left an extra
parenthesis.
|
|
|
|
|
|
|
|
|
|
|
|
When viewing attachments externally with a (non-copiousoutput) mailcap
entry missing %s, the command is invoked as a filter, with the
attachment piped into stdin. However, unlike a filter, the user
interacts with the command, instead of just displaying the output in
the pager.
Just as with the mutt_system() command, Mutt needs to send imap
keepalives to keep those connections from closing during the
potentially extended invocation.
Thanks to John Hawkinson for the bug report, and his suggested patch,
which this commit is based upon.
|
|
The virtual index is modeled after the CONTEXT. Add a CURATTACH
helper to reduce code verbosity. Store the actx as menu->data.
Simplify and consolidate the recvattach and compose menu update code
inside a function.
Because compose and recvattach share so much code, change compose to
use the virtual index even though it has no collapse/expand
functionality.
|
|
* Add a FP and BODY array to the actx. These are used to allow proper
cleanup.
* Add HEADER and root_fp entries, to allow for index regeneration.
* Separate out the compose and recvattach index generation functions.
* Change the recvattach index generator to decrypt as encrypted parts
are found.
|
|
Use the helper in compose update_idx(), to consolidate the resize
logic and simplify the code.
Separate out the actx "free" routine from a routine to empty out the
idx. The index regeneration routines should flush and rebuild the
index without having to renerate the actx structure.
|
|
Change the pager, compose, recvattach and recvcmd to pass the actx
instead of the individual idx and idxlen parameters.
Separate out the compose menu exit logic to first free the BODY data
and then call the shared actx free function at the bottom.
|
|
Move the idx and idxlen into ATTACH_CONTEXT. In subsequence patches,
this structure will hold more useful items, such as the virtual index.
The swap out is straightforward, except for:
* update_idx() in compose.c, which post-increments the idxlen in the
call and again in the function.
* mutt_gen_attach_list() which doesn't need to returns the new values.
|
|
(see #3886)
When piping a text attachment, there is no reliable way to know the
charset used.
Vincent Lefèvre says:
It was decided in the past that when there is no information on the
charset in a transmission to an external command (e.g. as for mail
composing), texts are expected to be transmitted in the local
charset.
Add a MUTT_CHARSET flag to enable charset conversion on text
attachments for both when $attach_split is set and unset.
|
|
The mx_close_message is one of the few mx_* functions that don't have a
context as parameter. To make them more consistent, pass the context.
|
|
Changeset 23334e967dd7 created a workaround for a namespace conflict
with Solaris and derivatives. After some discussion, the team decided
it would be best to move away from using the "M_" prefix for macros.
This patch was automatically generated by running:
perl -wpi -e 's/\bM_(\w+)\b/MUTT_$1/g' `find . -name '*.[ch]' -print`
with the exception that sys_socket.h was exempted. (That file will
be backed out subsequent to this commit.)
Thanks to Andras Salamon for supplying the perl script used to make
this change.
|
|
This patch only updates existing copyright notices in the source
files, using commit dates since the last copyright update in commits
e3af935cdb1a and f8fd60d8d3f2.
Add a notice to the COPYRIGHT file to refer to our mercurial
repository for the full commit history.
Add myself to the COPYRIGHT file and smime_keys.pl file.
|
|
The segfault was introduced in changeset b9f9e3147eb4. Since decoding
and charset conversion aren't needed for attachments when composing a
message, this patch reverts to just using mutt_save_attachment() to view
"raw data" for text attachments in the compose/send case.
This patch is based on Michael Elkins' patch at
http://dev.mutt.org/trac/attachment/ticket/3644/view_attach_compose_segfault
with just a missing return value check added.
|
|
closes #3293
see #3234
|
|
perform charset conversion
this change is meant to replace [392e945dfba7]
see #3234
see #3293
|
|
mailcap entry and either $implicit_autoview is set or the MIME type matches the user's auto_view list.
closes #3496
closes #3426
|
|
|
|
|
|
#3234.
|
|
|
|
|
|
We really need code for dynamic buffers which would solve a few other
bugs, too. Closes #2205.
|
|
|
|
I went through the logs of each file with a copyright header and
updated the years for the authors in the headers for any non-comment
changes they introduced. What a pain!
|
|
|