Re: [PATCH 2/2] Fix <get-attachment> to remove attachments upon compose abort.

"Kevin J. McCarthy" <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <[email protected]>
On Tue, Aug 25, 2026 at 12:56:30PM +0200, Alejandro Colomar via Mutt-dev wrote:
>> Date: 2026-08-25 18:00:25+0800
>> From: "Kevin J. McCarthy" <[email protected]>
>>
>> +          for (i = 0; i < actx->idxlen; i++)
>> +            if (actx->idx[i]->content->tagged &&
>> +                (mutt_get_tmp_attachment(actx->idx[i]->content) == 0))
>> +            {
>> +              actx->idx[i]->unowned = 0;
>> +            }
>
>This for loop feels quite weird (due to braces).  How about reversing
>one condition to split them?
>
>	for (i = 0; i < actx->idxlen; i++)
>	{
>	  if (!actx->idx[i]->content->tagged)
>	    continue;
>	  if (mutt_get_tmp_attachment(actx->idx[i]->content) == 0)
>	    actx->idx[i]->unowned = 0;
>	}

Sure.  Thanks Alex!

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmqNe5kACgkQre92hIAx
a9o52hAAggRI3ard66X0jbWfG3WPgUNuF3x00KzZrkdBgzBCi2I6kzTF6b2my2vN
fbgiLPAr0Toqf+QvbT3UsdmDRuB5h7ZnqH3pcnQ9KJ24PLGt98I0gYVIat/K/w8G
yHBqOEuI5bFA7nO4T3Ccl3sEJZbsuZBaGXhXiCTl5OeNjUBPIImFW687In2xXiLL
g+BmBZTJx3uwDGzx+wSZxMF+hHYktaTyWT+RXFHtKXNJzH0b62wvQH1jPkqNf3v+
k1JRmfYTTM2cGxX3Ixe38CcslFjQYpgjnUpadLSSZd0JK83t2ilTU3aP33lnSlvd
wCoT5BOPSzWjetIeeanKexM8XLGK4TZNKGaZEc8EPNCmkZyc/qv2Kv8vmzvrJ4xG
0nu4V6Wt9EXmFkSBzPa5kYqtb4AnlS9lHcQ6tffEFWs6UWgU6EpdHUsndRMO6DSw
cO2d35c3VMMmN8YNJ2F7VUuzKv+yW+BX7IgseXeCKbV/RWWZNxoFh586QccLWsmU
F6DxrwQYcUJsi5KTnESmzJStfhk4816INALi3DAFqly1V8Dy4zIueZFP1LFNCQd7
Yz/S6+V3lBsK+cpppq+CsbsSdMj3PlcN8z5XISkO1GcH/mTBIyVtjxiXbOxUjS5A
ZaPe+t0SRYUx2ua9Bo3xyTmPcVSsCuOXOF9ArwQJtTd1eFYdO4A=
=c1lJ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.