[Bf-committers] Long plugin path problem

Stephane SOPPERA bf-committers@blender.org
Mon, 22 Sep 2003 00:28:58 +0200


>
>
>>>I noticed today that the path of sequence plugins is limited to 80
>>>caracters (name member of the PluginSeq struct) and that strcpy is
>>>used to copy the path in this variable. So the memory is corrupted
>>>when the path for a plugin is longer than 80 characters (that's the
>>>case of many plugins on my system) and the plugin don't work ;-)
>>>
>>>An easy fix would be to set a bigger limit (bigger than FILE_MAXDIR
>>>which is quite small and lesser than PATH_MAX on my system). A better
>>>fix should be to use a C++ class for strings ;-)
>>>      
>>>
>
>Well since most of the code is in straight C, the second option is a bit 
>tedious...
>
Maybe you're right ;-)

>_POSIX_PATH_MAX is 256, so there's no reason to make it longer than that.
>
On my system (Linux Mandrake), MAX_PATH is 4096. That's NAME_MAX which 
is limited to 255. Why not set the length to the maximum length of the 
system blender is built on? Must this limit be the same for all systems? 
(actually I still haven't had enough time to see how blender stores 
informations to .blend files and what is stored. Since the absolute path 
does not make sense for a plugin, I'm not sure this path is stored in 
the .blend files. Is it stored?)

>  And 
>it even pads the DNA nicely.
>
What does that means?

Thanks for your answer.

-- 
Stephane SOPPERA
http://perso.wanadoo.fr/stephane.soppera