[MPlayer-cvslog] r32630 - in trunk: gui/interface.c libmenu/menu_pt.c mplayer.c path.c path.h

Yuriy Kaminskiy yumkam at mail.ru
Wed Nov 17 16:33:22 CET 2010


cboesch wrote:
> Author: cboesch
> Date: Tue Nov 16 22:06:52 2010
> New Revision: 32630
> 
> Log:
> Export mp_basename in a function instead of duplicate macros in various places
> 
> Modified:
>    trunk/gui/interface.c
>    trunk/libmenu/menu_pt.c
>    trunk/mplayer.c
>    trunk/path.c
>    trunk/path.h
> 
[...]
> Modified: trunk/path.c
> ==============================================================================
> --- trunk/path.c	Tue Nov 16 20:58:54 2010	(r32629)
> +++ trunk/path.c	Tue Nov 16 22:06:52 2010	(r32630)
> @@ -193,3 +193,16 @@ void set_codec_path(const char *path)
>      strcpy(codec_path, path);
>      needs_free = 1;
>  }
> +
> +const char *mp_basename(const char *path)
> +{
> +    char *s;
> +
> +#if HAVE_DOS_PATHS
> +    s = strrchr(path, '\\');
> +    if (s)
> +        return s + 1;
> +#endif
> +    s = strrchr(path, '/');
> +    return s ? s + 1 : s;
1) Return NULL and sigsegv on filenames without /.
s/: s;/: path;/
2) Not that I care about DoSish OS, but it does not work nice with both \ and /
in paths, like c:\foo/bar.avi

> +}
> 
> Modified: trunk/path.h
> ==============================================================================
> --- trunk/path.h	Tue Nov 16 20:58:54 2010	(r32629)
> +++ trunk/path.h	Tue Nov 16 22:06:52 2010	(r32630)
> @@ -26,5 +26,6 @@ extern char *codec_path;
>  char *get_path(const char *filename);
>  void set_path_env(void);
>  void set_codec_path(const char *path);
> +const char *mp_basename(const char *path);
>  
>  #endif /* MPLAYER_PATH_H */

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hotfix-mp_basename.patch
Type: text/x-diff
Size: 437 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-cvslog/attachments/20101117/42d13ccc/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dosish_combined_basename.patch
Type: text/x-diff
Size: 492 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-cvslog/attachments/20101117/42d13ccc/attachment-0001.patch>


More information about the MPlayer-cvslog mailing list