[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ln.c portability fix for hosts where / != //
From: |
Eric Blake |
Subject: |
Re: ln.c portability fix for hosts where / != // |
Date: |
Thu, 03 Nov 2005 06:42:39 -0700 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Paul Eggert on 10/28/2005 4:19 PM:
>
> * src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
> boundary between DEST and SOURCE in the result.
>
> #define FILE_BASENAME_CONCAT(new_dest, dest, source) \
> do
> \
> @@ -62,15 +65,18 @@
> const char *source_base; \
> char *tmp_source; \
> size_t buf_len = strlen (source) + 1; \
> + size_t dest_len = strlen (dest); \
> \
> tmp_source = alloca (buf_len); \
> memcpy (tmp_source, (source), buf_len); \
This isn't very consistent about parenthesizing the use of arguments to
the macro: strlen (source) vs. memcpy (..., (source), ...).
> strip_trailing_slashes (tmp_source); \
This still depends on a fix to lib/basename.c to treat base_name("//") as
"//" where it matters; I have a local patch for that, which I will polish
and submit here and to gnulib.
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDahPP84KuGfSFAYARAlwUAJwIgZ7DFq0EwnA1z3AGzR6zspRDvQCdH/P+
e7a4A9b4e6AFvj0KQnpPklE=
=N5Rt
-----END PGP SIGNATURE-----