stoddard 01/05/07 07:04:05
Modified: modules/metadata mod_cern_meta.c
Log:
Get mod_cern_meta to work on Windows. The problem was in the
"skip leading slash" logic, which is inheriently broken on Windows
because full Windows filenames begin with a drive letter or UNC
path.
Revision Changes Path
1.34 +5 -4 httpd-2.0/modules/metadata/mod_cern_meta.c
Index: mod_cern_meta.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_cern_meta.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- mod_cern_meta.c 2001/02/16 04:26:41 1.33
+++ mod_cern_meta.c 2001/05/07 14:03:59 1.34
@@ -309,6 +309,7 @@
static int add_cern_meta_data(request_rec *r)
{
char *metafilename;
+ char *leading_slash;
char *last_slash;
char *real_file;
char *scrap_book;
@@ -337,10 +338,10 @@
/* what directory is this file in? */
scrap_book = apr_pstrdup(r->pool, r->filename);
- /* skip leading slash, recovered in later processing */
- scrap_book++;
+
+ leading_slash = strchr(scrap_book, '/');
last_slash = strrchr(scrap_book, '/');
- if (last_slash != NULL) {
+ if ((last_slash != NULL) && (last_slash != leading_slash)) {
/* skip over last slash */
real_file = last_slash;
real_file++;
@@ -354,7 +355,7 @@
return DECLINED;
};
- metafilename = apr_pstrcat(r->pool, "/", scrap_book, "/",
+ metafilename = apr_pstrcat(r->pool, scrap_book, "/",
dconf->metadir ? dconf->metadir : DEFAULT_METADIR,
"/", real_file,
dconf->metasuffix ? dconf->metasuffix : DEFAULT_METASUFFIX,
|