X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=util.c;fp=util.c;h=bb5e9f3a49cefaa3004e4e72c6d4a618b2173f87;hb=a8a88eddaa90432e6ec1b8d9d5c9842bc91afd1d;hp=c06bcc42ec7dc7233b0d6402f75997d0ccbc840c;hpb=20fcfc81ece044b8b0a6768ec6cf47be4e22a2e6;p=debian%2Fgzip diff --git a/util.c b/util.c index c06bcc4..bb5e9f3 100644 --- a/util.c +++ b/util.c @@ -1,6 +1,6 @@ /* util.c -- utility functions for gzip support - Copyright (C) 1997-1999, 2001-2002, 2006, 2009-2016 Free Software + Copyright (C) 1997-1999, 2001-2002, 2006, 2009-2018 Free Software Foundation, Inc. Copyright (C) 1992-1993 Jean-loup Gailly @@ -29,6 +29,7 @@ #include "tailor.h" #include "gzip.h" +#include #include #ifndef CHAR_BIT @@ -299,18 +300,7 @@ char * gzip_base_name (fname) char *fname; { - char *p; - - if ((p = strrchr(fname, PATH_SEP)) != NULL) fname = p+1; -#ifdef PATH_SEP2 - if ((p = strrchr(fname, PATH_SEP2)) != NULL) fname = p+1; -#endif -#ifdef PATH_SEP3 - if ((p = strrchr(fname, PATH_SEP3)) != NULL) fname = p+1; -#endif -#ifdef SUFFIX_SEP - if ((p = strrchr(fname, SUFFIX_SEP)) != NULL) *p = '\0'; -#endif + fname = last_component (fname); if (casemap('A') == 'a') strlwr(fname); return fname; }