View | Details | Raw Unified | Return to bug 239167 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-4 / +6 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	fontconfig
4
PORTNAME=	fontconfig
5
PORTVERSION=	2.12.6
5
PORTVERSION=	2.13.1
6
PORTREVISION?=	0
6
PORTREVISION?=	0
7
PORTEPOCH?=	1
7
PORTEPOCH?=	1
8
CATEGORIES=	x11-fonts
8
CATEGORIES=	x11-fonts
Lines 19-24 Link Here
19
.if !defined(REFERENCE_PORT)
19
.if !defined(REFERENCE_PORT)
20
20
21
LIB_DEPENDS=	libfreetype.so:print/freetype2 \
21
LIB_DEPENDS=	libfreetype.so:print/freetype2 \
22
		libuuid.so:misc/e2fsprogs-libuuid \
22
		libexpat.so:textproc/expat2
23
		libexpat.so:textproc/expat2
23
24
24
USES+=		cpe gmake libtool pathfix pkgconfig
25
USES+=		cpe gmake libtool pathfix pkgconfig
Lines 40-47 Link Here
40
# D6155: static linked library linking added to support statically linked
41
# D6155: static linked library linking added to support statically linked
41
# 	 applications, e.g. x11/xforward static option
42
# 	 applications, e.g. x11/xforward static option
42
CONFIGURE_ARGS+=	--enable-static
43
CONFIGURE_ARGS+=	--enable-static
43
# Python is not required, because fc-blanks.h is available in distfile
44
CONFIGURE_ENV=	PYTHON=":"
45
44
46
PKGINSTALL=	${WRKDIR}/pkg-install
45
PKGINSTALL=	${WRKDIR}/pkg-install
47
INSTALL_TARGET=install-strip
46
INSTALL_TARGET=install-strip
Lines 49-55 Link Here
49
PLIST_SUB=	PREFERRED_HINTING=${PREFERRED_HINTING}
48
PLIST_SUB=	PREFERRED_HINTING=${PREFERRED_HINTING}
50
PORTDOCS=	fontconfig-user.html fontconfig-user.pdf fontconfig-user.txt
49
PORTDOCS=	fontconfig-user.html fontconfig-user.pdf fontconfig-user.txt
51
50
52
OPTIONS_DEFINE=	DOCS NO_BITMAPS
51
OPTIONS_DEFINE=	DOCS NO_BITMAPS NLS
53
OPTIONS_DEFAULT=HINTING_SLIGHT
52
OPTIONS_DEFAULT=HINTING_SLIGHT
54
OPTIONS_SUB=	yes
53
OPTIONS_SUB=	yes
55
54
Lines 63-68 Link Here
63
HINTING_${opt}_VARS=	PREFERRED_HINTING=${opt:tl}
62
HINTING_${opt}_VARS=	PREFERRED_HINTING=${opt:tl}
64
.endfor
63
.endfor
65
64
65
NLS_USES=		gettext
66
NLS_CONFIGURE_ENABLE=	nls
67
66
post-patch-NO_BITMAPS-on:
68
post-patch-NO_BITMAPS-on:
67
	@${REINPLACE_CMD} -i '.bitmaps.bak' -e \
69
	@${REINPLACE_CMD} -i '.bitmaps.bak' -e \
68
		'/^CONF_LINKS =/s|$$|\${.newline}	70-no-bitmaps.conf \\|' \
70
		'/^CONF_LINKS =/s|$$|\${.newline}	70-no-bitmaps.conf \\|' \
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1505981313
1
TIMESTAMP = 1550745725
2
SHA256 (fontconfig-2.12.6.tar.bz2) = cf0c30807d08f6a28ab46c61b8dbd55c97d2f292cf88f3a07d3384687f31f017
2
SHA256 (fontconfig-2.13.1.tar.bz2) = f655dd2a986d7aa97e052261b36aa67b0a64989496361eca8d604e6414006741
3
SIZE (fontconfig-2.12.6.tar.bz2) = 1624683
3
SIZE (fontconfig-2.13.1.tar.bz2) = 1723639
(-)files/patch-2.13.1.diff (+455 lines)
Line 0 Link Here
1
# Fix the build issue with --enable-static
2
# https://cgit.freedesktop.org/fontconfig/commit/?id=8208f99fa1676c42bfd8d74de3e9dac5366c150c
3
# Fix the issue that '~' wasn't extracted to the proper homedir
4
# https://cgit.freedesktop.org/fontconfig/commit/?id=806fd4c2c5164d66d978b0a4c579c157e5cbe766
5
# Add more prefix support in <dir> element
6
# https://cgit.freedesktop.org/fontconfig/commit/?id=1aa8b700c3f09a31c78e7834e0db373f80b5e226
7
# Update fonts.dtd for last commit
8
# https://cgit.freedesktop.org/fontconfig/commit/?id=67b4090321c0ec3cf3dc96f6d3cd7b9d03af0f25
9
# add missing the case of prefix="default" as documented
10
# https://cgit.freedesktop.org/fontconfig/commit/?id=e4788c5a96e0f384ad5702ad8096b0e144613895
11
# Do not update mtime when removing .uuid file
12
# https://cgit.freedesktop.org/fontconfig/commit/?id=ff5b49be2be0922f0fb6b9daf08f64a88d2fae6b
13
# Do not try updating mtime when unlink was failed
14
# https://cgit.freedesktop.org/fontconfig/commit/?id=5f5ec5676c61b9773026a9335c9b0dfa73a73353
15
# Do not remove UUID file when a scanned directory is empty
16
# https://cgit.freedesktop.org/fontconfig/commit/?id=5f12f564f8748deaa603adb7a4b8f616b6390ad4
17
# Fix name-table language code mapping for Mongolian
18
# https://cgit.freedesktop.org/fontconfig/commit/?id=f7036d589bffe353c1982b881afae6ec0a2ef200
19
# Use FC_PATH_MAX instead of PATH_MAX
20
# https://cgit.freedesktop.org/fontconfig/commit/?id=648e0cf3d5a53efeab93b24ae37490427d05229d
21
# Fix FcFontList doesn't return a font with FC_COLOR=true
22
# https://cgit.freedesktop.org/fontconfig/commit/?id=9d5149ac41e18ab67404ddba41d7ef7e71839ebc
23
# Fix a dereference of a null pointer
24
# https://cgit.freedesktop.org/fontconfig/commit/?id=b047e299546ac3abb79cf0bac3c67f5c2dfc7fb6
25
# Fix a crash with invalid matrix element
26
# https://cgit.freedesktop.org/fontconfig/commit/?id=699d6e4d8415a5d94483ea81fdf277964a33b8f1
27
# src/fccache.c: Fix define for HAVE_POSIX_FADVISE
28
# https://cgit.freedesktop.org/fontconfig/commit/?id=586e35450e9ca7c1dc647ceb9d75ac8ed08c5c16
29
# Reset errno to do error handling properly
30
# https://cgit.freedesktop.org/fontconfig/commit/?id=97fa77d27facc6a31486fdca5b3b853c591f792c
31
# fc-validate: returns an error code when missing some glyphs
32
# https://cgit.freedesktop.org/fontconfig/commit/?id=c336b8471877371f0190ba06f7547c54e2b890ba
33
# Fix endianness on generating MD5 cache name
34
# https://cgit.freedesktop.org/fontconfig/commit/?id=66b0af41b81c5f0db1a8f952beaaada95e221d14
35
# Fix a typo on masking face id
36
# https://cgit.freedesktop.org/fontconfig/commit/?id=c0dc76268bb278c4bd123afbfb3409be64d0ed75
37
# Fix the linear interpolation during weight mapping
38
# https://cgit.freedesktop.org/fontconfig/commit/?id=f2d4291d12ca1a2146d90da32a399fffff3e8227
39
# Fix a crash when running with FC_DEBUG=256
40
# https://cgit.freedesktop.org/fontconfig/commit/?id=322131f4330f972820fd903959999af9360120c0
41
# Fix a typo
42
# https://cgit.freedesktop.org/fontconfig/commit/?id=a57f22bf6d93ad4079a6ae01fa00456921dc73e1
43
# Add English name first into a cache
44
# https://cgit.freedesktop.org/fontconfig/commit/?id=2960391699ab3b417a17a0a2ac29e97e9c3d3c99
45
46
Excluding changes for the following files: .gitlab-ci.yml, doc/fcstring.fncs,
47
test/Makefile.am, test/test-bz106632.c, test/test-issue107.c, test/test-issue110.c
48
49
--- fc-validate/fc-validate.c.orig	2018-06-05 10:36:38 UTC
50
+++ fc-validate/fc-validate.c
51
@@ -197,6 +197,7 @@ main (int argc, char **argv)
52
 		{
53
 		    FcChar32 ucs4, pos, map[FC_CHARSET_MAP_SIZE];
54
 
55
+		    err = 1;
56
 		    printf (_("%s:%d Missing %d glyph(s) to satisfy the coverage for %s language\n"),
57
 			    argv[i], index, count, lang);
58
 
59
--- fontconfig/fontconfig.h.orig	2018-08-30 08:20:15 UTC
60
+++ fontconfig/fontconfig.h
61
@@ -1077,6 +1077,10 @@ FcUtf16Len (const FcChar8   *string,
62
 	    int		    *wchar);
63
 
64
 FcPublic FcChar8 *
65
+FcStrBuildFilename (const FcChar8 *path,
66
+		    ...);
67
+
68
+FcPublic FcChar8 *
69
 FcStrDirname (const FcChar8 *file);
70
 
71
 FcPublic FcChar8 *
72
--- fonts.dtd.orig	2016-12-02 03:22:19 UTC
73
+++ fonts.dtd
74
@@ -13,14 +13,18 @@
75
 -->
76
 <!ELEMENT dir (#PCDATA)>
77
 <!ATTLIST dir
78
-	  prefix    CDATA       "default"
79
-	  xml:space (default|preserve) 'preserve'>
80
+	  prefix    (default|xdg|relative|cwd)    "default"
81
+	  xml:space (default|preserve)            'preserve'>
82
 
83
 <!--
84
     Define the per-user file that holds cache font information.
85
 
86
     If the filename begins with '~', it is replaced with the users
87
     home directory path.
88
+
89
+    If 'prefix' is 'default' or 'cwd', then the current working directory will be added prior to the value.
90
+    If 'prefix' is 'xdg', then the value in the $XDG_DATA_HOME will be added prior to the value.
91
+    If 'prefix' is 'relative', then the path of curent file will be added prior to the value.
92
 -->
93
 <!ELEMENT cache (#PCDATA)>
94
 <!ATTLIST cache xml:space (default|preserve) 'preserve'>
95
--- src/fccache.c.orig	2018-07-19 07:05:17 UTC
96
+++ src/fccache.c
97
@@ -155,17 +155,42 @@ FcDirCacheDeleteUUID (const FcChar8  *di
98
 		      FcConfig       *config)
99
 {
100
     const FcChar8 *sysroot = FcConfigGetSysRoot (config);
101
-    FcChar8 *target;
102
+    FcChar8 *target, *d;
103
     FcBool ret = FcTrue;
104
+    struct stat statb;
105
+    struct timeval times[2];
106
 
107
     if (sysroot)
108
-	target = FcStrBuildFilename (sysroot, dir, ".uuid", NULL);
109
+	d = FcStrBuildFilename (sysroot, dir, NULL);
110
     else
111
-	target = FcStrBuildFilename (dir, ".uuid", NULL);
112
-
113
+	d = FcStrBuildFilename (dir, NULL);
114
+    if (FcStat (d, &statb) != 0)
115
+    {
116
+	ret = FcFalse;
117
+	goto bail;
118
+    }
119
+    target = FcStrBuildFilename (d, ".uuid", NULL);
120
     ret = unlink ((char *) target) == 0;
121
-    FcHashTableRemove (config->uuid_table, target);
122
-    FcStrFree(target);
123
+    if (ret)
124
+    {
125
+	times[0].tv_sec = statb.st_atime;
126
+	times[1].tv_sec = statb.st_mtime;
127
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
128
+	times[0].tv_usec = statb.st_atim.tv_nsec / 1000;
129
+	times[1].tv_usec = statb.st_mtim.tv_nsec / 1000;
130
+#else
131
+	times[0].tv_usec = 0;
132
+	times[1].tv_usec = 0;
133
+#endif
134
+	if (utimes ((const char *) d, times) != 0)
135
+	{
136
+	    fprintf (stderr, "Unable to revert mtime: %s\n", d);
137
+	}
138
+	FcHashTableRemove (config->uuid_table, target);
139
+    }
140
+    FcStrFree (target);
141
+bail:
142
+    FcStrFree (d);
143
 
144
     return ret;
145
 }
146
@@ -685,15 +710,18 @@ FcCacheRemoveUnlocked (FcCache *cache)
147
     while (fcCacheMaxLevel > 0 && fcCacheChains[fcCacheMaxLevel - 1] == NULL)
148
 	fcCacheMaxLevel--;
149
 
150
-    allocated = s->allocated;
151
-    while (allocated)
152
+    if (s)
153
     {
154
-	/* First element in allocated chunk is the free list */
155
-	next = *(void **)allocated;
156
-	free (allocated);
157
-	allocated = next;
158
+	allocated = s->allocated;
159
+	while (allocated)
160
+	{
161
+	    /* First element in allocated chunk is the free list */
162
+	    next = *(void **)allocated;
163
+	    free (allocated);
164
+	    allocated = next;
165
+	}
166
+	free (s);
167
     }
168
-    free (s);
169
 }
170
 
171
 static FcCache *
172
@@ -948,7 +976,7 @@ FcDirCacheMapFd (FcConfig *config, int f
173
     {
174
 #if defined(HAVE_MMAP) || defined(__CYGWIN__)
175
 	cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0);
176
-#if (HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
177
+#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
178
 	posix_fadvise (fd, 0, fd_stat->st_size, POSIX_FADV_WILLNEED);
179
 #endif
180
 	if (cache == MAP_FAILED)
181
@@ -1079,6 +1107,7 @@ FcDirChecksum (struct stat *statb)
182
     source_date_epoch = getenv("SOURCE_DATE_EPOCH");
183
     if (source_date_epoch)
184
     {
185
+	errno = 0;
186
 	epoch = strtoull(source_date_epoch, &endptr, 10);
187
 
188
 	if (endptr == source_date_epoch)
189
@@ -1685,7 +1714,7 @@ FcCacheNumFont args1(const FcCache *c)
190
  * will fill a supplied 16-byte array with the digest.
191
  */
192
 
193
-#ifndef HIGHFIRST
194
+#ifndef WORDS_BIGENDIAN
195
 #define byteReverse(buf, len)	/* Nothing */
196
 #else
197
 /*
198
--- src/fccfg.c.orig	2018-07-19 07:53:00 UTC
199
+++ src/fccfg.c
200
@@ -821,25 +821,25 @@ FcConfigCompareValue (const FcValue	*lef
201
 		break;
202
 	    case FcOpContains:
203
 	    case FcOpListing:
204
-		ret = left.u.b == right.u.b || left.u.b == FcDontCare;
205
+		ret = left.u.b == right.u.b || left.u.b >= FcDontCare;
206
 		break;
207
 	    case FcOpNotEqual:
208
 		ret = left.u.b != right.u.b;
209
 		break;
210
 	    case FcOpNotContains:
211
-		ret = !(left.u.b == right.u.b || left.u.b == FcDontCare);
212
+		ret = !(left.u.b == right.u.b || left.u.b >= FcDontCare);
213
 		break;
214
 	    case FcOpLess:
215
-		ret = left.u.b != right.u.b && right.u.b == FcDontCare;
216
+		ret = left.u.b != right.u.b && right.u.b >= FcDontCare;
217
 		break;
218
 	    case FcOpLessEqual:
219
-		ret = left.u.b == right.u.b || right.u.b == FcDontCare;
220
+		ret = left.u.b == right.u.b || right.u.b >= FcDontCare;
221
 		break;
222
 	    case FcOpMore:
223
-		ret = left.u.b != right.u.b && left.u.b == FcDontCare;
224
+		ret = left.u.b != right.u.b && left.u.b >= FcDontCare;
225
 		break;
226
 	    case FcOpMoreEqual:
227
-		ret = left.u.b == right.u.b || left.u.b == FcDontCare;
228
+		ret = left.u.b == right.u.b || left.u.b >= FcDontCare;
229
 		break;
230
 	    default:
231
 		break;
232
@@ -2207,17 +2207,19 @@ FcConfigFilename (const FcChar8 *url)
233
 	else
234
 	    file = 0;
235
     }
236
-
237
-    path = FcConfigGetPath ();
238
-    if (!path)
239
-	return NULL;
240
-    for (p = path; *p; p++)
241
+    else
242
     {
243
-	file = FcConfigFileExists (*p, url);
244
-	if (file)
245
-	    break;
246
+	path = FcConfigGetPath ();
247
+	if (!path)
248
+	    return NULL;
249
+	for (p = path; *p; p++)
250
+	{
251
+	    file = FcConfigFileExists (*p, url);
252
+	    if (file)
253
+		break;
254
+	}
255
+	FcConfigFreePath (path);
256
     }
257
-    FcConfigFreePath (path);
258
     return file;
259
 }
260
 
261
@@ -2231,7 +2233,7 @@ FcConfigRealFilename (FcConfig		*config,
262
 
263
     if (n)
264
     {
265
-	FcChar8 buf[PATH_MAX];
266
+	FcChar8 buf[FC_PATH_MAX];
267
 	ssize_t len;
268
 
269
 	if (sysroot)
270
--- src/fcdir.c.orig	2018-07-19 03:14:39 UTC
271
+++ src/fcdir.c
272
@@ -421,13 +421,6 @@ FcDirCacheRead (const FcChar8 *dir, FcBo
273
     /* Not using existing cache file, construct new cache */
274
     if (!cache)
275
 	cache = FcDirCacheScan (dir, config);
276
-    if (cache)
277
-    {
278
-	FcFontSet *fs = FcCacheSet (cache);
279
-
280
-	if (cache->dirs_count == 0 && (!fs || fs->nfont == 0))
281
-	    FcDirCacheDeleteUUID (dir, config);
282
-    }
283
 
284
     return cache;
285
 }
286
--- src/fcfreetype.c.orig	2018-08-01 06:41:28 UTC
287
+++ src/fcfreetype.c
288
@@ -193,9 +193,9 @@ static const FcFtLanguage   fcFtLanguage
289
  {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_KIRGHIZ,		    "ky" },
290
  {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_TAJIKI,		    "tg" },
291
  {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_TURKMEN,		    "tk" },
292
- {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_MONGOLIAN,	    "mo" },
293
- {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT,"mo" },
294
- {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT, "mo" },
295
+ {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_MONGOLIAN,	    "mn" },
296
+ {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT,"mn" },
297
+ {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT, "mn" },
298
  {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_PASHTO,		    "ps" },
299
  {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_KURDISH,		    "ku" },
300
  {  TT_PLATFORM_MACINTOSH,	TT_MAC_LANGID_KASHMIRI,		    "ks" },
301
@@ -1145,6 +1145,23 @@ typedef struct
302
   unsigned int idx;
303
 } FcNameMapping;
304
 
305
+static FcBool
306
+_is_english(int platform, int language)
307
+{
308
+    FcBool ret = FcFalse;
309
+
310
+    switch (platform)
311
+    {
312
+    case TT_PLATFORM_MACINTOSH:
313
+	ret = language == TT_MAC_LANGID_ENGLISH;
314
+	break;
315
+    case TT_PLATFORM_MICROSOFT:
316
+	ret = language == TT_MS_LANGID_ENGLISH_UNITED_STATES;
317
+	break;
318
+    }
319
+    return ret;
320
+}
321
+
322
 static int
323
 name_mapping_cmp (const void *pa, const void *pb)
324
 {
325
@@ -1154,7 +1171,7 @@ name_mapping_cmp (const void *pa, const 
326
   if (a->platform_id != b->platform_id) return (int) a->platform_id - (int) b->platform_id;
327
   if (a->name_id != b->name_id) return (int) a->name_id - (int) b->name_id;
328
   if (a->encoding_id != b->encoding_id) return (int) a->encoding_id - (int) b->encoding_id;
329
-  if (a->language_id != b->language_id) return (int) a->language_id - (int) b->language_id;
330
+  if (a->language_id != b->language_id) return _is_english(a->platform_id, a->language_id) ? -1 : _is_english(b->platform_id, b->language_id) ? 1 : (int) a->language_id - (int) b->language_id;
331
   if (a->idx != b->idx) return (int) a->idx - (int) b->idx;
332
 
333
   return 0;
334
@@ -1546,7 +1563,7 @@ FcFreeTypeQueryFaceInternal (const FT_Fa
335
 		    lang = FcSfntNameLanguage (&sname);
336
 
337
 		    if (FcDebug () & FC_DBG_SCANV)
338
-			printf ("%s\n", utf8);
339
+			printf ("%s\n", utf8 ? (char *)utf8 : "(null)");
340
 
341
 		    if (!utf8)
342
 			continue;
343
@@ -1606,7 +1623,7 @@ FcFreeTypeQueryFaceInternal (const FT_Fa
344
 	    printf ("using FreeType family \"%s\"\n", face->family_name);
345
 	if (!FcPatternAddString (pat, FC_FAMILY, (FcChar8 *) face->family_name))
346
 	    goto bail1;
347
-	if (!FcPatternAddString (pat, FC_STYLELANG, (FcChar8 *) "en"))
348
+	if (!FcPatternAddString (pat, FC_FAMILYLANG, (FcChar8 *) "en"))
349
 	    goto bail1;
350
 	++nfamily;
351
     }
352
@@ -2135,7 +2152,7 @@ FcFreeTypeQuery(const FcChar8	*file,
353
     if (FT_Init_FreeType (&ftLibrary))
354
 	return NULL;
355
 
356
-    if (FT_New_Face (ftLibrary, (char *) file, id & 0x7FFFFFFFF, &face))
357
+    if (FT_New_Face (ftLibrary, (char *) file, id & 0x7FFFFFFF, &face))
358
 	goto bail;
359
 
360
     if (count)
361
--- src/fcint.h.orig	2018-07-19 03:14:39 UTC
362
+++ src/fcint.h
363
@@ -1283,10 +1283,6 @@ FcPrivate FcBool
364
 FcStrIsAbsoluteFilename (const FcChar8 *s);
365
 
366
 FcPrivate FcChar8 *
367
-FcStrBuildFilename (const FcChar8 *path,
368
-		    ...);
369
-
370
-FcPrivate FcChar8 *
371
 FcStrLastSlash (const FcChar8  *path);
372
 
373
 FcPrivate FcChar32
374
--- src/fcweight.c.orig	2018-06-05 10:36:38 UTC
375
+++ src/fcweight.c
376
@@ -46,7 +46,7 @@ static double lerp(double x, int x1, int
377
   int dx = x2 - x1;
378
   int dy = y2 - y1;
379
   assert (dx > 0 && dy >= 0 && x1 <= x && x <= x2);
380
-  return y1 + (dy*(x-x1) + dx/2) / dx;
381
+  return y1 + (x-x1) * dy / dx;
382
 }
383
 
384
 double
385
--- src/fcxml.c.orig	2018-07-26 02:57:07 UTC
386
+++ src/fcxml.c
387
@@ -1480,6 +1480,11 @@ FcParseMatrix (FcConfigParse *parse)
388
     m.xy = FcPopExpr (parse);
389
     m.xx = FcPopExpr (parse);
390
 
391
+    if (!m.yy || !m.yx || !m.xy || !m.xx)
392
+    {
393
+	FcConfigMessage (parse, FcSevereWarning, "Missing values in matrix element");
394
+	return;
395
+    }
396
     if (FcPopExpr (parse))
397
       FcConfigMessage (parse, FcSevereError, "wrong number of matrix elements");
398
     else
399
@@ -2073,16 +2078,36 @@ FcParseDir (FcConfigParse *parse)
400
 #endif
401
 
402
     attr = FcConfigGetAttribute (parse, "prefix");
403
-    if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
404
+    data = FcStrBufDoneStatic (&parse->pstack->str);
405
+    if (attr)
406
     {
407
-	prefix = FcConfigXdgDataHome ();
408
-	/* home directory might be disabled.
409
-	 * simply ignore this element.
410
-	 */
411
-	if (!prefix)
412
-	    goto bail;
413
+	if (FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
414
+	{
415
+	    prefix = FcConfigXdgDataHome ();
416
+	    /* home directory might be disabled.
417
+	     * simply ignore this element.
418
+	     */
419
+	    if (!prefix)
420
+		goto bail;
421
+	}
422
+	else if (FcStrCmp (attr, (const FcChar8 *)"default") == 0 || FcStrCmp (attr, (const FcChar8 *)"cwd") == 0)
423
+	{
424
+	}
425
+	else if (FcStrCmp (attr, (const FcChar8 *)"relative") == 0)
426
+	{
427
+	    prefix = FcStrDirname (parse->name);
428
+	    if (!prefix)
429
+		goto bail;
430
+	}
431
     }
432
-    data = FcStrBufDoneStatic (&parse->pstack->str);
433
+#ifndef _WIN32
434
+    /* For Win32, check this later for dealing with special cases */
435
+    else
436
+    {
437
+	if (!FcStrIsAbsoluteFilename (data) && data[0] != '~')
438
+	    FcConfigMessage (parse, FcSevereWarning, "Use of ambiguous <dir> element. please add prefix=\"cwd\" if current behavior is desired.");
439
+    }
440
+#endif
441
     if (!data)
442
     {
443
 	FcConfigMessage (parse, FcSevereError, "out of memory");
444
@@ -2153,6 +2178,11 @@ FcParseDir (FcConfigParse *parse)
445
 	    strcat ((char *) data, "\\");
446
 	strcat ((char *) data, "fonts");
447
     }
448
+    else if (!attr)
449
+    {
450
+	if (!FcStrIsAbsoluteFilename (data) && data[0] != '~')
451
+	    FcConfigMessage (parse, FcSevereWarning, "Use of ambiguous <dir> element. please add prefix=\"cwd\" if current behavior is desired.");
452
+    }
453
 #endif
454
     if (strlen ((char *) data) == 0)
455
 	FcConfigMessage (parse, FcSevereWarning, "empty font directory name ignored");
(-)pkg-plist (-1 / +7 lines)
Lines 1-5 Link Here
1
bin/fc-cache
1
bin/fc-cache
2
bin/fc-cat
2
bin/fc-cat
3
bin/fc-conflist
3
bin/fc-list
4
bin/fc-list
4
bin/fc-match
5
bin/fc-match
5
bin/fc-pattern
6
bin/fc-pattern
Lines 67-76 Link Here
67
lib/libfontconfig.a
68
lib/libfontconfig.a
68
lib/libfontconfig.so
69
lib/libfontconfig.so
69
lib/libfontconfig.so.1
70
lib/libfontconfig.so.1
70
lib/libfontconfig.so.1.10.1
71
lib/libfontconfig.so.1.12.0
71
libdata/pkgconfig/fontconfig.pc
72
libdata/pkgconfig/fontconfig.pc
72
man/man1/fc-cache.1.gz
73
man/man1/fc-cache.1.gz
73
man/man1/fc-cat.1.gz
74
man/man1/fc-cat.1.gz
75
man/man1/fc-conflist.1.gz
74
man/man1/fc-list.1.gz
76
man/man1/fc-list.1.gz
75
man/man1/fc-match.1.gz
77
man/man1/fc-match.1.gz
76
man/man1/fc-pattern.1.gz
78
man/man1/fc-pattern.1.gz
Lines 78-81 Link Here
78
man/man1/fc-scan.1.gz
80
man/man1/fc-scan.1.gz
79
man/man1/fc-validate.1.gz
81
man/man1/fc-validate.1.gz
80
man/man5/fonts-conf.5.gz
82
man/man5/fonts-conf.5.gz
83
share/gettext/its/fontconfig.its
84
share/gettext/its/fontconfig.loc
85
%%NLS%%share/locale/zh_CN/LC_MESSAGES/fontconfig-conf.mo
86
%%NLS%%share/locale/zh_CN/LC_MESSAGES/fontconfig.mo
81
@dir /var/db/fontconfig
87
@dir /var/db/fontconfig

Return to bug 239167