diff options
author | Patrick Lam <plam@MIT.EDU> | 2006-01-14 21:23:03 +0000 |
---|---|---|
committer | Patrick Lam <plam@MIT.EDU> | 2006-01-14 21:23:03 +0000 |
commit | 8a0b0ed6d01e4e20ab6727211fe5823395a9b4c4 (patch) | |
tree | 4c4317ffa425c8b71dffa0f24be6d922e4947995 /fc-cat/fc-cat.c | |
parent | df3efc11a9584e2099366c31ba64ac9346760321 (diff) |
Compare device numbers as well as inodes. Always normalize directory names
before comparing them.
Allocate extra space for appended '/' in directory name.
reviewed by: plam
Diffstat (limited to 'fc-cat/fc-cat.c')
-rw-r--r-- | fc-cat/fc-cat.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fc-cat/fc-cat.c b/fc-cat/fc-cat.c index 419d29ff..3b24302d 100644 --- a/fc-cat/fc-cat.c +++ b/fc-cat/fc-cat.c @@ -205,7 +205,11 @@ FcCacheGlobalFileReadAndPrint (FcFontSet * set, FcStrSet *dirs, char *cache_file if (!FcDirCacheConsume (fd, name_buf, set, 0)) goto bail1; - dir = strdup(name_buf); + dir = malloc (strlen (name_buf) + 2); + if (!dir) + goto bail1; + + strcpy (dir, name_buf); strcat (dir, "/"); FcCachePrintSet (set, dirs, dir); |