The description of the function FcStrCopyFilename states: "Just like FcStrCopy except that it converts any leading '~' characters in s to the value of the HOME environment variable". Meanwhile the description of the function FcStrCopy states: "Allocates memory, copies s and returns the resulting buffer". But, if the name of the input file is not a full path and its first character is not '~', the function FcStrCopyFilename adds the current directory to the returning value.
For example, if the current work directory of the program is '/home/ssdk/Testing/FcStringUtils/', the call of the function FcStrCopyFilename with the parameter '123' returns the string '/home/ssdk/Testing/FcStringUtils/123', what contradicts the documentation.
The detailed bug description can be found at:
FcStrCopyFilename does a lot more than the documentation mentions. I've updated the docs to reflect its full scope:
<function>FcStrCopyFilename</function> constructs an absolute pathname from
<parameter>s</parameter>. It converts any leading '~' characters in
to the value of the HOME environment variable, and any relative paths are
converted to absolute paths using the current working directory. Sequences
of '/' characters are converted to a single '/', and names containing the
current directory '.' or parent directory '..' are correctly reconstructed.
Returns NULL if '~' is the leading character and HOME is unset or disabled
*** Bug 12965 has been marked as a duplicate of this bug. ***