[MPlayer-dev-eng] [PATCH] Filename double-conversion

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Nov 16 12:32:57 CET 2006


Hello,
On Thu, Nov 16, 2006 at 07:04:00PM +0800, Zuxy Meng wrote:
> 2006/11/16, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> >On linux this is a full 4k, and I could easily expect that some systems
> >might not have any limit at all, but at least one much larger.
> >I would vote towards restricting this to something more like 512 bytes,
> >and maybe just adding '...' if it was not possible to convert it fully
> 
> Well, that'll change the original behavior: without the patch the
> filename gets printed as is no matter how long it is. If you're

The patch will change that anyway (note: the filename that is printed
does not have to be valid, and esp. not < PATH_MAX). My argument is that
if we add a limit, at least choose a sensible one and think of some way
to handle the case when we hit the limit. PATH_MAX, even if available on
all supported OS, is still quite unpredictable.

> concerned about the memory consumption, then recoded_filename can be
> malloc'ed dynamically. But things'll be slowed down a bit....

That AFAICT will make you patch massively more complicated. Unless you
intend to malloc it but still have a fixed size. Then the only advantage
would be clearing 4096 bytes less at startup.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list