[Mplayer-cvslog] CVS: main/libmpdemux cue_read.c,1.3,1.4

Arpi of Ize arpi at mplayerhq.hu
Mon Jan 6 02:12:33 CET 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv7716

Modified Files:
	cue_read.c 
Log Message:
dirname() (from libgen) dependency removed
patch by "Steven M. Schultz" <sms at 2BSD.COM>


Index: cue_read.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cue_read.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- cue_read.c	6 Jan 2003 00:47:47 -0000	1.3
+++ cue_read.c	6 Jan 2003 01:12:30 -0000	1.4
@@ -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);
 



More information about the MPlayer-cvslog mailing list