Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fontconfig
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ben Wagner
fontconfig
Commits
13d2a47d
Commit
13d2a47d
authored
Apr 04, 2019
by
Akira TAGOH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unexpected cache name by double-slash in path
parent
faec0b51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
7 deletions
+41
-7
src/fccfg.c
src/fccfg.c
+9
-7
test/run-test.sh
test/run-test.sh
+32
-0
No files found.
src/fccfg.c
View file @
13d2a47d
...
...
@@ -612,7 +612,7 @@ FcConfigMapFontPath(FcConfig *config,
{
FcStrList
*
list
;
FcChar8
*
dir
;
const
FcChar8
*
map
;
const
FcChar8
*
map
,
*
rpath
;
FcChar8
*
retval
;
list
=
FcConfigGetFontDirs
(
config
);
...
...
@@ -627,15 +627,17 @@ FcConfigMapFontPath(FcConfig *config,
map
=
FcStrTripleSecond
(
dir
);
if
(
!
map
)
return
0
;
retval
=
FcStrBuildFilename
(
map
,
path
+
strlen
((
char
*
)
dir
),
NULL
);
rpath
=
path
+
strlen
((
char
*
)
dir
);
while
(
*
rpath
==
'/'
)
rpath
++
;
retval
=
FcStrBuildFilename
(
map
,
rpath
,
NULL
);
if
(
retval
)
{
size_t
len
=
strlen
((
const
char
*
)
retval
);
if
(
retval
[
len
-
1
]
==
'/'
)
{
/* trim the last slash */
retval
[
len
-
1
]
=
0
;
}
while
(
len
>
0
&&
retval
[
len
-
1
]
==
'/'
)
len
--
;
/* trim the last slash */
retval
[
len
]
=
0
;
}
return
retval
;
}
...
...
test/run-test.sh
View file @
13d2a47d
...
...
@@ -156,6 +156,10 @@ ls -l $CACHEDIR > out2
if
cmp out1 out2
>
/dev/null
;
then
:
;
else
echo
"*** Test failed:
$TEST
"
echo
"cache was created/updated."
echo
"Before:"
cat
out1
echo
"After:"
cat
out2
exit
1
fi
if
[
x
`
cat
xxx
`
!=
"x
$TESTTMPDIR
/fonts/4x6.pcf"
]
;
then
...
...
@@ -220,7 +224,35 @@ if cmp flist1 flist2 > /dev/null ; then
fi
rm
-rf
$TESTTMPDIR
$TESTTMP2DIR
out1 out2 xxx flist1 flist2 stat1 stat2 bind-fonts.conf
dotest
"Check consistency of MD5 in cache name"
prep
mkdir
-p
$FONTDIR
/sub
cp
$FONT1
$FONTDIR
/sub
$FCCACHE
$FONTDIR
sleep
1
(
cd
$CACHEDIR
;
ls
-1
--color
=
no
*
cache
*
)
>
out1
TESTTMPDIR
=
`
mktemp
-d
/tmp/fontconfig.XXXXXXXX
`
mkdir
-p
$TESTTMPDIR
/cache.dir
sed
"s!@FONTDIR@!
$TESTTMPDIR
/fonts!
s!@REMAPDIR@!<remap-dir as-path="
'"'
"
$FONTDIR
"
'"'
">
$TESTTMPDIR
/fonts</remap-dir>!
s!@CACHEDIR@!
$TESTTMPDIR
/cache.dir!"
<
$TESTDIR
/fonts.conf.in
>
bind-fonts.conf
cat
bind-fonts.conf
$BWRAP
--bind
/ /
--bind
$FONTDIR
$TESTTMPDIR
/fonts
--bind
..
$TESTTMPDIR
/build
--dev-bind
/dev /dev
--setenv
FONTCONFIG_FILE
$TESTTMPDIR
/build/test/bind-fonts.conf
$TESTTMPDIR
/build/fc-cache/fc-cache
$EXEEXT
$TESTTMPDIR
/fonts
(
cd
$TESTTMPDIR
/cache.dir
;
ls
-1
--color
=
no
*
cache
*
)
>
out2
if
cmp out1 out2
>
/dev/null
;
then
:
;
else
echo
"*** Test failed:
$TEST
"
echo
"cache was created unexpectedly."
echo
"Before:"
cat
out1
echo
"After:"
cat
out2
exit
1
fi
rm
-rf
$TESTTMPDIR
out1 out2 bind-fonts.conf
else
echo
"No bubblewrap installed. skipping..."
fi
# if [ x"$BWRAP" != "x" -a "x$EXEEXT" = "x" ]
if
[
"x
$EXEEXT
"
=
"x"
]
;
then
dotest
"sysroot option"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment