changeset 12493:6b11ffd069cf

1e6l
author henry
date Fri, 21 May 2004 16:02:09 +0000
parents 4b8417674f1c
children 0e76a9c38546
files subreader.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Thu May 20 21:34:10 2004 +0000
+++ b/subreader.c	Fri May 21 16:02:09 2004 +0000
@@ -1045,11 +1045,13 @@
 void	subcp_open_noenca ()
 {
     char enca_lang[100], enca_fallback[100];
-    if (sscanf(sub_cp, "enca:%2s:%s", enca_lang, enca_fallback) == 2
-	|| sscanf(sub_cp, "ENCA:%2s:%s", enca_lang, enca_fallback) == 2) {
-	subcp_open(enca_fallback);
-    } else {
-	subcp_open(sub_cp);
+    if (sub_cp) {
+	if (sscanf(sub_cp, "enca:%2s:%s", enca_lang, enca_fallback) == 2
+	    || sscanf(sub_cp, "ENCA:%2s:%s", enca_lang, enca_fallback) == 2) {
+	    subcp_open(enca_fallback);
+	} else {
+	    subcp_open(sub_cp);
+	}
     }
 }
 #else