[MPlayer-users] [PATCH] dirname undefined

D Richard Felker III dalias at aerifal.cx
Mon Jan 6 01:21:51 CET 2003


Please send patches to the devel list. Also could you mention what
system you're using that's missing dirnamr?

Rich


On Sun, Jan 05, 2003 at 04:13:53PM -0800, Steven M. Schultz wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi -
> 
> 	Dirname doesn't appear to exist for me.
> 
> 	I do have strrchr though ;)
> 
> 	Steven Schultz
> 	sms at 2bsd.com
> 
> --- libmpdemux/cue_read.c.dist	Sun Jan  5 15:51:05 2003
> +++ libmpdemux/cue_read.c	Sun Jan  5 16:13:08 2003
> @@ -8,7 +8,9 @@
>  #include <sys/stat.h>
>  #include <unistd.h>
>  #include <fcntl.h>
> +#ifdef	__linux__
>  #include <libgen.h>
> +#endif
>  
>  #include "config.h"
>  #include "mp_msg.h"
> @@ -291,7 +293,11 @@
>  
>    /* split the filename into a path and filename part */
>    s = strdup(in_cue_filename);
> -  t = dirname(s);
> +  t = strrchr(s, '/');
> +  if (t == (char *)NULL)
> +     t = s;
> +  else
> +     t++;
>    printf ("dirname: %s\n", t);
>    strcpy(bincue_path,t);
>  
> 
> _______________________________________________
> RTFM!!!  http://www.MPlayerHQ.hu/DOCS
> Search:  http://www.MPlayerHQ.hu/cgi-bin/htsearch
> http://mplayerhq.hu/mailman/listinfo/mplayer-users



More information about the MPlayer-users mailing list