[MPlayer-dev-eng] Export mp_basename in a function

Clément Bœsch ubitux at gmail.com
Thu Nov 11 22:57:00 CET 2010


On Thu, Nov 11, 2010 at 08:44:53PM +0100, Reimar Döffinger wrote:
> On Thu, Nov 11, 2010 at 05:32:14PM +0100, Clément Bœsch wrote:
> > @@ -193,3 +193,16 @@ void set_codec_path(const char *path)
> >      strcpy(codec_path, path);
> >      needs_free = 1;
> >  }
> > +
> > +char *mp_basename(char *path)
> > +{
> > +	char *s;
> > +
> > +#if HAS_DOS_PATHS
> > +	s = strrchr(path, '\\');
> > +	if (s)
> > +		return s + 1;
> > +#endif
> > +	s = strrchr(path, '/');
> > +	return s ? s + 1 : s;
> > +}
> 
> Please use 4 spaces for indentation if you add a completely new
> function and the surrounding code does not consistently use
> something else.

Oh my bad. I have no excuse, the code above was using the correct indent.
No, I just forgot to set the correct config and just didn't realize. It
won't happen again :)

> Also please use "const char" instead of "char" (I think
> you might have to change some more code to avoid new warnings,
> but I think it should be possible without real issues).

Sure, patch updated. It didn't generate a single warning. Also, I realized
I made a huge mistake in the macro name but I'm surprised I didn't noticed
it. Fixed too.

Anything else?

-- 
Clément B.
Not sent from a jesusPhone.


More information about the MPlayer-dev-eng mailing list