Syntax file core dumps mc

Roland Illig roland.illig at gmx.de
Fri Apr 15 21:39:44 UTC 2005


Roland Illig wrote:
> Ian Zagorskih wrote:
> 
>>
>> mc-4.6.1-pre4a
>>
>> Synopsis:
>>
>> Looks like mc core dumps when it cannot find "context default" section 
>> in syntax file.
> 
> 
> Thanks for the bug report. I can reproduce it, and I'm working on a 
> solution.

And here it is. The code that was erroneous was ugly, and so looks my 
patch. It adds a field to the editor that notes how many rules have been 
defined and takes its actions based on this number.

It has just been a weird idea to start an array with index 1 in C ...

I suggest that we replace code that uses NULL-terminated arrays with 
code that has an extra length (or count, or whatever) field. That way we 
can easily put assert()s before array indexes to ensure they are valid.

Roland
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mcedit-segv.patch
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20050415/2fe04954/attachment.ksh>


More information about the mc-devel mailing list