Closed timj closed 10 years ago
c220348488bb9916a083dbe3b85f1a7a593be008 seems to have fixed the abort on OS X but has broken HLP. For example:
$ kaphelp
Hel
Welcome to the KAPPA online help system. Here you can display
details about specific KAPPA commands. For more general information
such as using this help system, consult SUN/95. This can be most easily
done using the command "showme sun95".
Additional information available:
AD APERAD ARDGE ARDMAS ARDPLO AXCON AXLABE AXUNIT
CAL CALPO CARPE CDI CENTROI CHAI CHANMA CHPI
so the final character is being removed from each section. Selecting a section continues to indicate the truncation:
Additional information available:
Parameter Example Note Related_Application Copyrigh Licenc Author Histor
I wonder if the new hlpStrncp
is not working properly.
We have decided to leave the memmove()
patch in place and not attempt further upgrades of HLP.
The
crehlp
command no longer works on OS X Mavericks. The reason is thatstrncpy
is being used to copy characters within the same buffer and the behavior of this is undefined. This is the code fromcreh.c
:In line 385 we copy characters from
iobuf
intoiobuf
. For the example inconvert/tasks.hlp
ifrom
has a value of 2 and so this line ends up copying the contents from the same position. It seems that Mavericks now has overlap detection code in place that triggers an abort at runtime. It seems that if we are really intending to shift characters from the end ofiobuf
to position 2 ofiobuf
then we should probably change the code to usememmove
and terminate the resultant buffer ourself at positionl+2
:The above patch seems to be enough to get help library created again.
The build system doesn't seem to care that
crehlp
is failing, and I think that is because of a related bug inhlib
where the return value fromcrehlp
is not trapped: