summaryrefslogtreecommitdiff
path: root/src/library.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/library.c')
-rw-r--r--src/library.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/library.c b/src/library.c
index 3512649..b359c45 100644
--- a/src/library.c
+++ b/src/library.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/lib/Xcursor/library.c,v 1.2 2003/01/26 03:22:42 eich Exp $
+ * $XFree86: xc/lib/Xcursor/library.c,v 1.4 2003/11/11 01:17:54 dawes Exp $
*
* Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -101,12 +101,19 @@ _XcursorBuildThemeDir (const char *dir, const char *theme)
if (!home)
return 0;
homelen = strlen (home);
+ /* A '/' gets prepended if $HOME doesn't start with one. */
+ if (home[0] != '/')
+ homelen++;
dir++;
dirlen--;
}
len = homelen + dirlen + 1 + themelen + 1;
+ /* A '/' gets inserted if dir doesn't start with one. */
+ if (dir[0] != '/')
+ len++;
+
full = malloc (len);
if (!full)
return 0;