[MPlayer-dev-eng] [PATCH] Make use of mp_basename in a few places

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Dec 4 11:17:05 CET 2010


On Sat, Dec 04, 2010 at 12:05:38AM +0100, Clément Bœsch wrote:
> @@ -95,11 +96,7 @@ static rar_stream_t *rar_open(const char *const filename,
>              strcat(rar_filename, ".rar");
>          }
>          /* get rid of the path if there is any */
> -        if ((p = strrchr(filename, '/')) == NULL) {
> -            p = filename;
> -        } else {
> -            p++;
> -        }
> +        p = (char *)mp_basename(filename);

Huh? p is already const char *, this cast should be pointless.
Apart from that, considering that most of those implementations
you are replacing are buggy I'd say go ahead, can't break already
broken code that much.


More information about the MPlayer-dev-eng mailing list