[PATCH 1/2] Rename strcpy_strip_ext to strcpy_strip_ext_lower.

Clément Bœsch ubitux at gmail.com
Tue Jan 11 00:52:05 CET 2011


strcpy_strip_ext is another function I need.
---
 sub/subreader.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/sub/subreader.c b/sub/subreader.c
index 4877dc6..5542002 100644
--- a/sub/subreader.c
+++ b/sub/subreader.c
@@ -1847,6 +1847,11 @@ static void strcpy_strip_ext(char *d, const char *s)
 	strncpy(d, s, tmp-s);
 	d[tmp-s] = 0;
     }
+}
+
+static void strcpy_strip_ext_lower(char *d, const char *s)
+{
+    strcpy_strip_ext(d, s);
     while (*d) {
 	*d = tolower(*d);
 	d++;
@@ -1929,7 +1934,7 @@ static void append_dir_subtitles(struct sub_list *slist, const char *path,
 
     tmpresult = malloc(len);
 
-    strcpy_strip_ext(f_fname_noext, f_fname);
+    strcpy_strip_ext_lower(f_fname_noext, f_fname);
     strcpy_trim(f_fname_trim, f_fname_noext);
 
     tmp_sub_id = NULL;
@@ -1947,7 +1952,7 @@ static void append_dir_subtitles(struct sub_list *slist, const char *path,
 	    mp_msg(MSGT_SUBREADER, MSGL_INFO, "Load subtitles in %s\n", path);
 	    while ((de = readdir(d))) {
 		// retrieve various parts of the filename
-		strcpy_strip_ext(tmp_fname_noext, de->d_name);
+		strcpy_strip_ext_lower(tmp_fname_noext, de->d_name);
 		strcpy_get_ext(tmp_fname_ext, de->d_name);
 		strcpy_trim(tmp_fname_trim, tmp_fname_noext);
 
-- 
1.7.3.5


--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename="0002-Replace-hacky-vobsub-loading-with-a-new-clean-one.patch"



More information about the MPlayer-dev-eng mailing list