From e5baf9cb9d3b10d09edef22d01b43b630900170f Mon Sep 17 00:00:00 2001 From: Ryu Sawada Date: Sun, 9 Oct 2005 15:57:36 +0000 Subject: [PATCH] directory separator for windows. --- mxml.c | 2 +- mxml.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mxml.c b/mxml.c index 5242345..be0d8a9 100755 --- a/mxml.c +++ b/mxml.c @@ -1727,7 +1727,7 @@ int mxml_parse_entity(char **buf, char *file_name, char *error, int error_size) /* read external file */ for (i = 0; i < nentity; i++) { if (entity_type[i] == EXTERNAL_ENTITY) { - sprintf(filename, "%s/%s", directoryname, entity_reference_name[i]); + sprintf(filename, "%s%c%s", directoryname, DIR_SEPARATOR, entity_reference_name[i]); fh = open(filename, O_RDONLY | O_TEXT, 0644); if (fh == -1) { diff --git a/mxml.h b/mxml.h index 3705507..dafa27e 100755 --- a/mxml.h +++ b/mxml.h @@ -23,6 +23,12 @@ #define EXTERNAL_ENTITY 1 #define MXML_MAX_ENTITY 1000 +#ifdef _MSC_VER +#define DIR_SEPARATOR '\\' +#else +#define DIR_SEPARATOR '/' +#endif + typedef struct { int fh; char *buffer;