This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Found a potential setup.exe problem while working on cygcheck


----- Original Message -----
From: "Christopher Faylor" <cgf@redhat.com>
To: <cygwin-apps@cygwin.com>
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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]