In our previous episode, Michael Van Canneyt said:
> > so it seems to be the emptychar story. Better fix that as well.
> > Unfortunately, FPC_emptychar is not exported from system.
> 
> No, and you cannot use that directly, because in case of an error, the items 
> in the argv 
> array and the array itself are freed (or so I hope). 
> The FPC_emptychar pointer should not be freed...

I found that out too. The patch I send earlier therefore only copies from
it, but better maybe to eliminate the use of emptychar entirely.

> fixing strnew() to allocate a single #0 on the heap is probably best.

strnew uses stralloc which in turn can only be disposed with strdispose. 
(prefixes 4 bytes length and futhers the pointer) In theory one can make
thus an exception in strdispose too, but IMHO not worth it.
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to