Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Tue, 18 Jun 2002 22:28:28 +0200 From: Pavel Tsekov Reply-To: Pavel Tsekov X-Priority: 3 (Normal) Message-ID: <1555866405.20020618222828@gmx.net> To: cygwin AT cygwin DOT com Subject: [PATCH] Setup 2.249.2.3 on Win2k hangs while uninstalling pack ages In-Reply-To: <000201c21701$1c416890$e5091bac@ELPASO> References: <000201c21701$1c416890$e5091bac AT ELPASO> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----------11D2A92E4F706A" ------------11D2A92E4F706A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello Robert, Tuesday, June 18, 2002, 9:48:24 PM, you wrote: RLO> I also have determined that three packages that are in RLO> /etc/setup/installed.db RLO> are missing from /etc/setup: [snip] Thanks to the hints Corey and you have provided I was able to pinpoint the problem :) Attached is a patch to fix the problem. The rest is possibly only of interest to setup developers... This was pretty nasty one... The String class was added a new constructor accepting an 'int' at some point. This conflicts with methods returning String objects which use the following construct to indicate an error: if (FALSE) return 0; The intent here was to return an empty string by calling the String constructor which accepts 'const char *', but with the introduction of the new constructor a String object with size of 1 is actually returned - it contains the string "0" :) I haven't checked the source for other occurences of such methods, but I guess there may be more of them. I'll try to do this when I get some more time (the weekend maybe). Changelog: It's somewhat lenghty, so you can tweak it to your likes :) 2002-06-18 Pavel Tsekov * cygpackage.cc (cygpackage::getfirstfile): Return a pointer to an empty C string, instead of int, so that the proper String constructor will be called. (cygpackage::getnextfile): Ditto. ------------11D2A92E4F706A Content-Type: application/octet-stream; name="cygpackage.cc.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="cygpackage.cc.diff" LS0tIGN5Z3BhY2thZ2UuY2MJMjAwMi0wNi0xOCAyMjowNTo0Mi4wMDAwMDAwMDAgKzAyMDAKKysr IGN5Z3BhY2thZ2UuY2MucGF0Y2hlZAkyMDAyLTA2LTE4IDIyOjA1OjUyLjAwMDAwMDAwMCArMDIw MApAQCAtMTIwLDcgKzEyMCw3IEBAIGN5Z3BhY2thZ2U6OmdldGZpcnN0ZmlsZSAoKQogICAgIGlv X3N0cmVhbTo6b3BlbiAoU3RyaW5nICgiY3lnZmlsZTovLy9ldGMvc2V0dXAvIikgKyBuYW1lICsg Ii5sc3QuZ3oiLCAicmIiKTsKICAgbGlzdGRhdGEgPSBjb21wcmVzczo6ZGVjb21wcmVzcyAobGlz dGZpbGUpOwogICBpZiAoIWxpc3RkYXRhKQotICAgIHJldHVybiAwOworICAgIHJldHVybiAiIjsK ICAgcmV0dXJuIGxpc3RkYXRhLT5nZXRzIChnZXRmaWxlbmFtZWJ1ZmZlciwgc2l6ZW9mIChnZXRm aWxlbmFtZWJ1ZmZlcikpOwogfQogCkBAIC0xMjksNyArMTI5LDcgQEAgY3lncGFja2FnZTo6Z2V0 bmV4dGZpbGUgKCkKIHsKICAgaWYgKGxpc3RkYXRhKQogICAgIHJldHVybiBsaXN0ZGF0YS0+Z2V0 cyAoZ2V0ZmlsZW5hbWVidWZmZXIsIHNpemVvZiAoZ2V0ZmlsZW5hbWVidWZmZXIpKTsKLSAgcmV0 dXJuIDA7CisgIHJldHVybiAiIjsKIH0KIAogdm9pZAo= ------------11D2A92E4F706A Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ ------------11D2A92E4F706A--