aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Innes2000-12-06 15:54:02 +0000
committerAndrew Innes2000-12-06 15:54:02 +0000
commitceb1287747df12542ea692dbedd116e6530284dc (patch)
treeae187363c1c727ece927343917d9410df08b9f8f /src
parentd4b72d58bccd897cf21261c4b89b850317c42d98 (diff)
downloademacs-ceb1287747df12542ea692dbedd116e6530284dc.tar.gz
emacs-ceb1287747df12542ea692dbedd116e6530284dc.zip
(xlfd_charset_of_font): Don't overwrite fontname
argument. (w32_codepage_for_font): Rename CP_INVALID to CP_UNKNOWN. (w32_list_fonts): Don't choke if pattern doesn't specify a codepage.
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 9fe4a451b39..50c86d5e944 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5459,12 +5459,10 @@ char * xlfd_charset_of_font (char * fontname)
5459 char *charset, *encoding; 5459 char *charset, *encoding;
5460 5460
5461 encoding = strrchr(fontname, '-'); 5461 encoding = strrchr(fontname, '-');
5462 if (!encoding) 5462 if (!encoding || encoding == fontname)
5463 return NULL; 5463 return NULL;
5464 5464
5465 *encoding = 0; 5465 charset = strrchr(encoding - 1, '-');
5466 charset = strrchr(fontname, '-');
5467 *encoding = '-';
5468 5466
5469 if (!charset || strcmp(charset, "-*-*") == 0) 5467 if (!charset || strcmp(charset, "-*-*") == 0)
5470 return NULL; 5468 return NULL;
@@ -6030,7 +6028,7 @@ w32_codepage_for_font (char *fontname)
6030 charset = xlfd_charset_of_font (fontname); 6028 charset = xlfd_charset_of_font (fontname);
6031 6029
6032 if (!charset) 6030 if (!charset)
6033 return CP_INVALID; 6031 return CP_UNKNOWN;
6034 6032
6035 charset_str = (char *) alloca (strlen (charset)); 6033 charset_str = (char *) alloca (strlen (charset));
6036 strcpy (charset_str, charset); 6034 strcpy (charset_str, charset);
@@ -6051,7 +6049,7 @@ w32_codepage_for_font (char *fontname)
6051 6049
6052 entry = Fassoc (build_string(charset), Vw32_charset_info_alist); 6050 entry = Fassoc (build_string(charset), Vw32_charset_info_alist);
6053 if (NILP (entry)) 6051 if (NILP (entry))
6054 return CP_INVALID; 6052 return CP_UNKNOWN;
6055 6053
6056 codepage = Fcdr (Fcdr (entry)); 6054 codepage = Fcdr (Fcdr (entry));
6057 6055
@@ -6062,7 +6060,7 @@ w32_codepage_for_font (char *fontname)
6062 else if (INTEGERP (codepage)) 6060 else if (INTEGERP (codepage))
6063 return XINT (codepage); 6061 return XINT (codepage);
6064 else 6062 else
6065 return CP_INVALID; 6063 return CP_UNKNOWN;
6066} 6064}
6067 6065
6068 6066
@@ -6705,7 +6703,8 @@ w32_list_fonts (FRAME_PTR f, Lisp_Object pattern, int size, int maxnames )
6705 going to be able to output one of these anyway. */ 6703 going to be able to output one of these anyway. */
6706 codepage = w32_codepage_for_font (XSTRING (tpat)->data); 6704 codepage = w32_codepage_for_font (XSTRING (tpat)->data);
6707 if (codepage != CP_8BIT && codepage != CP_UNICODE 6705 if (codepage != CP_8BIT && codepage != CP_UNICODE
6708 && codepage != CP_DEFAULT && !IsValidCodePage(codepage)) 6706 && codepage != CP_DEFAULT && codepage != CP_UNKNOWN
6707 && !IsValidCodePage(codepage))
6709 continue; 6708 continue;
6710 6709
6711 /* See if we cached the result for this particular query. 6710 /* See if we cached the result for this particular query.