Mercurial > mplayer.hg
changeset 8815:74dd9b5cc7f6
dirname() (from libgen) dependency removed
patch by "Steven M. Schultz" <sms@2BSD.COM>
author | arpi |
---|---|
date | Mon, 06 Jan 2003 01:12:30 +0000 |
parents | 9e4ef4ee2a06 |
children | 341d8083491a |
files | libmpdemux/cue_read.c |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/cue_read.c Mon Jan 06 01:07:17 2003 +0000 +++ b/libmpdemux/cue_read.c Mon Jan 06 01:12:30 2003 +0000 @@ -8,7 +8,6 @@ #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> -//#include <libgen.h> #include "config.h" #include "mp_msg.h" @@ -33,9 +32,6 @@ #define MODE2_2336 40 #define UNKNOWN -1 -// from libgen: -extern char *dirname(char *path); - static FILE* fd_cue; static int fd_bin = 0; @@ -293,7 +289,15 @@ /* 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 = "."; + else { + *t = '\0'; + t = s; + if (*t) + strcpy(t, "/"); + } printf ("dirname: %s\n", t); strcpy(bincue_path,t);