[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make CVS HEAD version build out of the box
From: |
Yongwei Wu |
Subject: |
Re: Make CVS HEAD version build out of the box |
Date: |
Tue, 2 Oct 2007 19:57:10 +0800 |
On 02/10/2007, Eli Zaretskii <address@hidden> wrote:
> > Date: Mon, 01 Oct 2007 22:34:30 +0200
> > From: Eli Zaretskii <address@hidden>
> > Cc: address@hidden
> >
> > It's valid C, allright, but the code clearly wants not to modify the
> > `name' argument to the function, and the function's prototype promises
> > that it won't be modified. So modifying it would be a breach of
> > contract between the function and its callers. If, for example, at
> > some point, `find_directory' is passed a constant string literal as
> > its argument, Make could crash at run time.
> >
> > I will suggest an alternative patch in a while.
>
> Here's my suggestion. Could Yongwei Wu please test this and see if it
> works?
[patch snipped]
The patch itself is good. Can I suggest a small alternative?
--- dir.c.bak 2007-10-02 19:33:52.281250000 +0800
+++ dir.c 2007-10-02 19:35:35.656250000 +0800
@@ -457,10 +457,11 @@
r = vmsstat_dir (name, &st);
#elif defined(WINDOWS32)
{
- char tem[MAXPATHLEN], *t;
+ char *tem, *t;
/* Remove any trailing slashes. Windows32 stat fails even on
valid directories if they end in a slash. */
+ tem = alloca (p - name + 1);
memcpy (tem, name, p - name + 1);
t = tem + (p - name - 1);
if (*t == '/' || *t == '\\')
Best regards,
Yongwei
--
Wu Yongwei
URL: http://wyw.dcweb.cn/
- Re: Make CVS HEAD version build out of the box, (continued)
- Re: Make CVS HEAD version build out of the box, Eli Zaretskii, 2007/10/03
- Re: Make CVS HEAD version build out of the box, Yongwei Wu, 2007/10/09
- Re: Make CVS HEAD version build out of the box, Eli Zaretskii, 2007/10/09
- Re: Make CVS HEAD version build out of the box, Paul Smith, 2007/10/09
- Re: Make CVS HEAD version build out of the box, Yongwei Wu, 2007/10/09
- Re: Make CVS HEAD version build out of the box, Paul Smith, 2007/10/10
- Re: Make CVS HEAD version build out of the box, Eli Zaretskii, 2007/10/10
Re: Make CVS HEAD version build out of the box, grischka, 2007/10/01
- Re: Make CVS HEAD version build out of the box, Eli Zaretskii, 2007/10/01
- Re: Make CVS HEAD version build out of the box, Paul Smith, 2007/10/02
- Re: Make CVS HEAD version build out of the box, Eli Zaretskii, 2007/10/03
- Re: Make CVS HEAD version build out of the box, Yongwei Wu, 2007/10/03
- Re: Make CVS HEAD version build out of the box, Eli Zaretskii, 2007/10/03
Re: Make CVS HEAD version build out of the box, Earnie Boyd, 2007/10/03
Re: Make CVS HEAD version build out of the box, Eli Zaretskii, 2007/10/03
Re: Make CVS HEAD version build out of the box, Paul Smith, 2007/10/03