<<< Date Index >>>     <<< Thread Index >>>

length of path variables



Hello list!

While writing a tool which exploits the $editor variable (puts a lengthy
vim script inside), I realized that all path variables are limited to
_POSIX_PATH_MAX (= 256) characters, which is often too short in my case.
Of course I could also use an external script, but I prefer this
solution for flexibility and convenience. But also otherwise, it is kind
of counter-intuitive that the configuration variables have such a huge
difference in maximum length (path: 256 <-> string: 1024).

I thought about how to cleanly increase this limit, and came up with two
solutions:

1. Add a new variable type "command"
This would make sense, since lots of variables are not really path names
(although they usually contain one at the beginning), but commands that
are handed over to system(3) and do not obey any maximum file path limit
anyway. Currently, all those variables ($display_filter, $editor, ...)
are expanded using mutt_expand_path(), which does not make much sense
besides the tilde [~] for HOME (who uses $spoolfile at the beginning of
$editor?), so this could lead to a cleaner handling.

2. Increase the limit for all variables of type "path"
I have no idea of the vast amount of different UNIX flavors that mutt is
supporting, so I don't know if this could be a problem. I would guess
1024 would be safe (could also be checked by autoconf!), but really, I
don't know. The advantage would be that the change is almost invisible,
and that strings and paths are of roughly equal length (editor=$my_foo
doesn't lead to surprises).


In both cases, the changes wouldn't be that drastic (mostly some
temporary buffers would need to be increased). What do you think about
the idea in general and the two solutions in particular? If I write
patches, is there any chance to get them accepted?


Johannes

Attachment: pgpbmNG5uUt9G.pgp
Description: PGP signature