[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs & MAXPATHLEN
From: |
Giuseppe Scrivano |
Subject: |
Re: emacs & MAXPATHLEN |
Date: |
Sat, 30 Jul 2005 14:58:03 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Well.. this code seems cleaner than the older one and without memory leaks :)
"Alfred M\. Szmidt" <address@hidden> writes:
> and leaks memory. If the path is 400, you do 3 mallocs, but the
> first two are never freed.
>
> That is just a small matter of moving the free outside the if. :-)
>
> int buf_size = 100;
> while (1)
> {
> buf = (char *) xmalloc (buf_size);
> if (getcwd (buf, buf_size) == buf)
> break;
> free (buf);
> if (errno != ERANGE)
> fatal ("`getcwd' failed: %s\n", strerror (errno));
> size *= 2;
> }
- Re: emacs & MAXPATHLEN, (continued)
- Re: emacs & MAXPATHLEN, Richard M. Stallman, 2005/07/31
- Re: emacs & MAXPATHLEN, Richard M. Stallman, 2005/07/30
- Re: emacs & MAXPATHLEN, Giuseppe Scrivano, 2005/07/30
- Re: emacs & MAXPATHLEN, Alfred M\. Szmidt, 2005/07/30
- Re: emacs & MAXPATHLEN, Jan D., 2005/07/30
- Re: emacs & MAXPATHLEN, Alfred M\. Szmidt, 2005/07/30
- Re: emacs & MAXPATHLEN,
Giuseppe Scrivano <=
- Re: emacs & MAXPATHLEN, Andreas Schwab, 2005/07/30
- Re: emacs & MAXPATHLEN, Giuseppe Scrivano, 2005/07/30
- Re: emacs & MAXPATHLEN, Giuseppe Scrivano, 2005/07/30
- Re: emacs & MAXPATHLEN, Richard M. Stallman, 2005/07/30
- Re: emacs & MAXPATHLEN, Giuseppe Scrivano, 2005/07/30
- Re: emacs & MAXPATHLEN, Richard M. Stallman, 2005/07/31
- Re: emacs & MAXPATHLEN, Eli Zaretskii, 2005/07/29
- Re: emacs & MAXPATHLEN, Richard M. Stallman, 2005/07/30