test-path-utils: handle const parameter of basename and dirname
commit29c2eda80b9d9528ccc881387a0b955249403cbb
authorRené Scharfe <l.s.r@web.de>
Mon, 7 Aug 2017 13:57:31 +0000 (7 15:57 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Aug 2017 17:50:08 +0000 (7 10:50 -0700)
tree5a54809a2f5bf8ce20e128d4c2a3a248f1a65c8a
parentb06d3643105c8758ed019125a4399cb7efdcce2c
test-path-utils: handle const parameter of basename and dirname

The parameter to basename(3) and dirname(3) traditionally had the type
"char *", but on OpenBSD it's been "const char *" for years.  That
causes (at least) Clang to throw an incompatible-pointer-types warning
for test-path-utils, where we try to pass around pointers to these
functions.

Avoid this warning (which is fatal in DEVELOPER mode) by ignoring the
promise of OpenBSD's implementations to keep input strings unmodified
and enclosing them in POSIX-compatible wrappers.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-path-utils.c