gEDA-dev: Bug in PCB found cross-compiling for windows

Peter Clifton pcjc2 at cam.ac.uk
Sat May 12 14:07:27 EDT 2007


Hi,

I think I discovered a bug in PCB when cross-compiling for windows. The
getenv( "HOME" ) is used without checking. When running under wine, I
found this returned a NULL pointer. I'm not sure what it would return on
a windows box.

(Thanks to wine's lack of decent debugging, this was a pain in the
printf to discover!)

I did find one reference to windows providing "HOMEPATH" as a variable,
so my patch checks for that too, it doesn't seem to help under wine.

Attached is a patch which fixes the GTK hid, there is a similar block of
code in the lesstif hid too. Other places in PCB accessing
getenv( "HOME" ) do check for NULL pointer returns.

There is a strdup (getenv( "PATH" )) in main.c which "could" come
unstuck if we have no path too, I guess.

Anyway... now I've got a pcb.exe which runs. I'm not sure how much more
than that it does, as the GTK binaries I'm using don't work well under
wine... the fonts are about 1/3 a screen per character!

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: homepath_win32_wine_bug.patch
Type: text/x-patch
Size: 1404 bytes
Desc: not available
Url : http://www.seul.org/pipermail/geda-dev/attachments/20070512/78002156/homepath_win32_wine_bug.bin


More information about the geda-dev mailing list