summaryrefslogtreecommitdiff
path: root/samus/sa_misc.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2005-06-04 22:40:20 +0200
committerTor Andersson <tor@ghostscript.com>2005-06-04 22:40:20 +0200
commit7560c64207af372f7d75763285a6e955d3e68486 (patch)
tree18a05e892eeca41ba6d4c3c7f71e51154cbdfce3 /samus/sa_misc.c
parent7c7a2ed5417f36780da11299ed463d8861cad762 (diff)
downloadmupdf-7560c64207af372f7d75763285a6e955d3e68486.tar.xz
fixed document sequence parsing
Diffstat (limited to 'samus/sa_misc.c')
-rw-r--r--samus/sa_misc.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/samus/sa_misc.c b/samus/sa_misc.c
index 109e3693..0f71b4a2 100644
--- a/samus/sa_misc.c
+++ b/samus/sa_misc.c
@@ -2,6 +2,32 @@
#include "samus.h"
/*
+ * Create a new canonical absolute path given both
+ * a base url (current directory) and a relative or absolute name.
+ */
+char *
+sa_resolvepath(char *dst, char *baseurl, char *parturl, int dstlen)
+{
+ char *end;
+
+ if (parturl[0] == '/')
+ {
+ strlcpy(dst, parturl, dstlen);
+ }
+ else
+ {
+ strlcpy(dst, baseurl, dstlen);
+ end = strrchr(dst, '/');
+ if (end)
+ end[1] = 0;
+ strlcat(dst, parturl, dstlen);
+ cleanname(dst);
+ }
+
+ return dst;
+}
+
+/*
* Test part names for equivalence.
*
* What we *should* do here (according to the spec) is...