httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: cvs commit: apache-2.0/src/lib/apr/lib apr_cpystrn.c
Date Wed, 13 Oct 1999 21:28:29 GMT
on win32, both / and \ are path separators... no?  (or is this only used
in situations where we've changed / to \ ?)

Dean

On 13 Oct 1999 rbb@hyperreal.org wrote:

>   +
>   +/* Filename_of_pathname returns the final element of the pathname.
>   + * Using the current platform's filename syntax.
>   + *   "/foo/bar/gum" -> "gum"
>   + *   "/foo/bar/gum/" -> ""
>   + *   "gum" -> "gum"
>   + *   "wi\\n32\\stuff" -> "stuff
>   + */
>   +
>   +const char *ap_filename_of_pathname(const char *pathname)
>   +{
>   +#ifdef WIN32
>   +    const char path_separator = '\\';
>   +#else
>   +    const char path_separator = '/';
>   +#endif
>   +    const char *s = strrchr(pathname, path_separator);
>   +
>   +    return s ? ++s : pathname;
>   +}
>   +
>   
>   
>   
> 


Mime
View raw message