From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78854 invoked by alias); 24 Feb 2017 19:15:21 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 78843 invoked by uid 89); 24 Feb 2017 19:15:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=moot X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: smtp.gentoo.org Date: Fri, 24 Feb 2017 19:15:00 -0000 From: Mike Frysinger To: Ulf Hermann Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH] Check for existence of asprintf and vasprintf Message-ID: <20170224191504.GX28432@vapier> Mail-Followup-To: Ulf Hermann , elfutils-devel@sourceware.org References: <20170222144004.GV28432@vapier> <3716c28b-6478-ee4d-50cf-0ef43e8196f3@qt.io> <20170222163249.GW28432@vapier> <59040cc2-f681-7610-5115-9a7c6c94b6c9@qt.io> <20170222170356.GX28432@vapier> <84aaee58-674a-5b94-7047-f4770faff345@qt.io> <20170222185737.GE28432@vapier> <8bc5640c-cb84-bda2-50be-f7b1bb7c35de@qt.io> <20170223185129.GU28432@vapier> <11ab9e08-3d39-1edd-b493-8d569f6a2cb6@qt.io> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NqE6tsP4GBwPxixq" Content-Disposition: inline In-Reply-To: <11ab9e08-3d39-1edd-b493-8d569f6a2cb6@qt.io> X-SW-Source: 2017-q1/txt/msg00088.txt.bz2 --NqE6tsP4GBwPxixq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1083 On 24 Feb 2017 10:42, Ulf Hermann wrote: > >> and the GNU variant is a whopping two lines of code: > >> > >> char *base =3D strrchr(path, '/'); > >> return base ? base + 1 : (char *)path; > > > > and we get straight to an example of why your solutions don't scale. > > your replacement is wrong. and ironically, it's wrong on Windows, > > which is the whole point of your work. '/' is not the path sep used > > on every system out there. it also does not properly handle systems > > (such as Windows) that have filesystem prefixes like C:\. >=20 > Both basename variants' documentations only talk about '/'. This is not=20 > the place where we should handle windows directory separators. umm, sure it is. if dirname/basename don't handle the OS separator, then where do you think it should be handled ? every place that calls basename ? GNU/POSIX not talking about it isn't terribly relevant -- they don't care about systems like Windows that have diff path name semantics. although it's a moot point if you move everything to gnulib as they handle the issue properly. -mike --NqE6tsP4GBwPxixq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAliwhjgACgkQQWM7n+g3 9YHbnA//eSzxAkNgSKBC32dlqZMpFKVkuHl7kOS0TuHsWkLViaMHCjG4ZgdLjZLT Ffw1jKOVz7hNNFsixoHV2oO3sHYUUIzhsH8V8dxh8wIRBr55P6p+kTY7djaSrREF fkCuI4X4nQejcTHxfW88BIF9/i5w/y7dEuEBvuRa1c7MPQO56Mb2CYop0JAz2nvq aa/TIMY6k6N/vsq/7y4D1VUXEDPD11HH6SLeEeeYE5ucI31GosRi64YahE7aB5Gb tqINVwYaCk4rFp21n1UwVRj9jrENxA+C3mbOPJIn0mVavaVwpohzg/jLqZJ1wVci dEDdA6/JOzca+pyWpIEMkiBZm7AbDI23fYAWAb4MLdpZYLumgbAIT5xAoC64Qys0 IorzEGXdlzfHmO9YFiC7pA/2QKKo0Da2ihuLMZsIegNPy1kTQLryl7L5Xh/vo+m3 f4MpLUQgxdRx74hJYUtjkPxRHlq4my8PfZXuI31RWzKaYm1z0aBvPV9/hUYABuqA 83jcXWYujFVoWjevgcDRqw0ThgP9rYnWo3XIUhjEOEZ4xUvzXXT9RrxZHmi5zzqn 3l0qb+b89IWuUIQdoO4ETwoRhIjXnBWJTtXx2LXBqyh1IYrJ9NS3mNZnUGR1LEFk kCs/IznVKF4gPc6YEpQgZo9Wi6NrouAbU8EtAdUcLrUNijZOxbI= =pe+c -----END PGP SIGNATURE----- --NqE6tsP4GBwPxixq--