X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org X-Mailer: 21.4 (patch 21) "Educational Television" XEmacs Lucid (via feedmail 10 I) To: cygwin AT cygwin DOT com Subject: Re: [Attn: alternatives maintainer] - ghostscript preremove breakage References: <7zk5j0yt70 DOT fsf AT vzell-de DOT de DOT oracle DOT com> <4803E1B3 DOT 8070809 AT cwilson DOT fastmail DOT fm> <7zbq4ct3wv DOT fsf AT vzell-de DOT de DOT oracle DOT com> <48040493 DOT 7010205 AT cwilson DOT fastmail DOT fm> <7zprsrqfzm DOT fsf AT vzell-de DOT de DOT oracle DOT com> <480576DA DOT 5070106 AT cwilson DOT fastmail DOT fm> From: "Dr. Volker Zell" Date: Wed, 16 Apr 2008 08:14:36 +0200 In-Reply-To: <480576DA.5070106@cwilson.fastmail.fm> (Charles Wilson's message of "Tue, 15 Apr 2008 23:47:38 -0400") Message-ID: <7z63uipbqr.fsf@vzell-de.de.oracle.com> User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.21 (cygwin32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com >>>>> 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/