>>>>> Charles Wilson writes: > Dr. Volker Zell wrote: >> This is the relevant code block in alternatives.c where the above >> file gets read by the function readConfig (buf should hold the >> contents of the above file after the do loop): >> curBufSz = READCONFIG_BUF_INITIALSZ; >> totalBytesRead = 0; >> numBytesRead = 0; >> buf = NULL; >> do >> { >> if (curBufSz < READCONFIG_BUF_BEHAVIOR_THRESH) >> curBufSz *= 2; >> else >> curBufSz += READCONFIG_BUF_BEHAVIOR_THRESH; >> buf = realloc(buf, curBufSz + 1); >> bufp = buf + totalBytesRead;
> try putting > *bufp = '\0'; > right here. Yup. That's fixes it. 07:51 AM [525]> ./alternatives.exe --display gs gs - status is auto. link currently points to /usr/bin/gs-x11 /usr/bin/gs-x11 - priority 20 Current `best' version is /usr/bin/gs-x11. 07:51 AM [526]> ./alternatives.exe --display unison unison - status is auto. link currently points to /usr/bin/unison-2.27 /usr/bin/unison-2.13 - priority 2013 /usr/bin/unison-2.17 - priority 2017 /usr/bin/unison-2.27 - priority 2027 Current `best' version is /usr/bin/unison-2.27. Thanks, will you roll a new version ? Volker -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/