Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com Message-ID: <039601c16b00$88417dd0$0200a8c0@lifelesswks> From: "Robert Collins" To: References: <20011111060349 DOT GA23640 AT redhat DOT com> Subject: Re: [PATCH] Found a potential setup.exe problem while working on cygcheck Date: Mon, 12 Nov 2001 09:30:56 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-OriginalArrivalTime: 11 Nov 2001 22:36:48.0662 (UTC) FILETIME=[59AB4360:01C16B01] ----- Original Message ----- From: "Christopher Faylor" To: Sent: Sunday, November 11, 2001 5:03 PM Subject: [PATCH] Found a potential setup.exe problem while working on cygcheck > Here's YA reason for a unified library. I found a problem while working > on cygcheck. AFAICT, my code was correct but gcc was miscompiling it, > ending up with a value of 'p' which was not a pointer. > > The code below fixes that problem. > > Does this look ok? It seems to do the right thing in cygcheck. Sure, but I think I've found the bug... > cgf > > > if (!f.what[0]) > { > p = strchr (ver, '\0'); > strcpy (f.pkgtar, in_fn); > if ((p -= 4) >= ver && strcasecmp (p, "-src") == 0) > { > strcpy (f.what, "src"); > *p = '\0'; > p = f.pkgtar + (p - fn) + 4; .......................^^^^^^.... (- fn) is a constant, as fn is a local variable. This seems wrong to me, as p is set relative to f. Rob