[Lsb-messages] /var/www/bzr/lsb/4.1/t2c-desktop-tests r81: Backport fix for bug 3663 from devel
Stew Benedict
stewb at linux-foundation.org
Fri Feb 1 18:20:42 UTC 2013
------------------------------------------------------------
revno: 81
committer: Stew Benedict <stewb at linux-foundation.org>
branch nick: t2c-desktop-tests
timestamp: Fri 2013-02-01 13:20:42 -0500
message:
Backport fix for bug 3663 from devel
modified:
desktop-t2c/fontconfig-t2c/src/FcConfig/FcConfig.t2c
desktop-t2c/package/Makefile
-------------- next part --------------
=== modified file 'desktop-t2c/fontconfig-t2c/src/FcConfig/FcConfig.t2c'
--- a/desktop-t2c/fontconfig-t2c/src/FcConfig/FcConfig.t2c 2012-04-05 13:46:40 +0000
+++ b/desktop-t2c/fontconfig-t2c/src/FcConfig/FcConfig.t2c 2013-02-01 18:20:42 +0000
@@ -21,6 +21,8 @@
//#define CONF_FILE_TAG3 "SYSTEM"
#define DIR "/etc/fonts/conf.d"
#define SEPARATOR "|"
+#define DIR_TAG_PREFIX "<dir"
+#define DIR_TAG_CLOSE ">"
#define DIR_TAG_BEGIN "<dir>"
#define DIR_TAG_END "</dir>"
#define RESC_TAG_BEGIN "<rescan>"
@@ -32,6 +34,8 @@
#define _HOME_CHAR '~'
#define _HOME "HOME"
#define HOME_ENV getenv (_HOME)
+#define XDG_DIR "/.local/share/"
+#define SLASH "/"
#define HEXADECIMAL 16
#define MAX_BLANKS 66000
@@ -285,9 +289,9 @@
}
while (fgets ((char *)str, MEM, file))
{
- while ((s = (FcChar8 *)strstr ((char *)str, DIR_TAG_BEGIN)))
+ while ((s = (FcChar8 *)strstr ((char *)str, DIR_TAG_PREFIX)))
{
- strcpy ((char *)str1, (char *)s + strlen (DIR_TAG_BEGIN));
+ strcpy ((char *)str1, (char *)(strstr ((char *)str, DIR_TAG_CLOSE) + 1));
strcpy ((char *)str, (char *)(strstr ((char *)str, DIR_TAG_END) + strlen (DIR_TAG_END)));
char* pret = strstr ((char *)str1, DIR_TAG_END);
if (pret == NULL)
@@ -302,6 +306,12 @@
ABORT_TEST_PURPOSE ("Could not allocate memory for the string");
}
strcpy ((char *)str1, SEPARATOR);
+ // xdg style entries have no leading '/'
+ if (strncmp((char *)ss, SLASH, 1) != 0)
+ {
+ strcat ((char *)str1, HOME_ENV);
+ strcat ((char *)str1, XDG_DIR);
+ }
strcat ((char *)str1, (char *)ss);
free (ss);
if (!(strstr((char *)dirs, (char *)str1)))
@@ -646,6 +656,7 @@
FcChar8 dirs[MEM];
FILE *file;
FcBool b;
+ int dirs_n = 0;
if (!(fc = FcConfigGetCurrent ()))
{
@@ -671,9 +682,9 @@
}
while (fgets ((char *)str, MEM, file))
{
- while ((s = (FcChar8 *)strstr ((char *)str, DIR_TAG_BEGIN)))
+ while ((s = (FcChar8 *)strstr ((char *)str, DIR_TAG_PREFIX)))
{
- strcpy ((char *)str1, (char *)s + strlen (DIR_TAG_BEGIN));
+ strcpy ((char *)str1, (char *)(strstr ((char *)str, DIR_TAG_CLOSE) + 1));
strcpy ((char *)str, (char *)(strstr ((char *)str, DIR_TAG_END) + strlen (DIR_TAG_END)));
*strstr ((char *)str1, DIR_TAG_END) = '\0';
strcat ((char *)str1, SEPARATOR);
@@ -682,21 +693,34 @@
ABORT_TEST_PURPOSE ("Could not allocate memory for the string");
}
strcpy ((char *)str1, SEPARATOR);
+ // xdg style entries have no leading '/'
+ if (strncmp((char *)ss, SLASH, 1) != 0)
+ {
+ strcat ((char *)str1, HOME_ENV);
+ strcat ((char *)str1, XDG_DIR);
+ }
strcat ((char *)str1, (char *)ss);
free (ss);
if (!(strstr((char *)dirs, (char *)str1)))
{
strcat ((char *)dirs, (char *)(str1 + 1));
- }
+ dirs_n++;
+ }
}
}
}
- /*Checking if all dir names ares in dirs and dirs_n == n*/
- fsl_dirs = FcConfigGetConfigDirs (fc);
+ /*Checking if all dir names are in dirs*/
+ fsl_dirs = FcConfigGetFontDirs (fc);
b = FcTrue;
+ int lcount = 0;
while ((dirname = FcStrListNext (fsl_dirs)))
{
+ // FcConfigGetFontDirs seems to return additional
+ // things not reported by FcConfigGetConfigFiles
+ lcount++;
+ if (lcount > dirs_n)
+ break;
strcpy ((char *)str, SEPARATOR);
strcat ((char *)str, (char *)dirname);
strcat ((char *)str, SEPARATOR);
=== modified file 'desktop-t2c/package/Makefile'
--- a/desktop-t2c/package/Makefile 2012-06-10 14:20:41 +0000
+++ b/desktop-t2c/package/Makefile 2013-02-01 18:20:42 +0000
@@ -1,6 +1,6 @@
PACKAGE=lsb-test-desktop-t2c
-VERSION=4.1.2
-RELEASE=2
+VERSION=4.1.3
+RELEASE=1
# Derive date string for daily snapshots
ISO_DATE=$(shell date +"%Y%m%d")
More information about the lsb-messages
mailing list