xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject cvs commit: xml-xalan/c/samples/ApacheModuleXSLT mod_xslt.c
Date Sat, 04 Jan 2003 20:28:13 GMT
dbertoni    2003/01/04 12:28:13

  Modified:    c/samples/ApacheModuleXSLT mod_xslt.c
  Log:
  Patch for bug 15791.
  
  Revision  Changes    Path
  1.9       +27 -1     xml-xalan/c/samples/ApacheModuleXSLT/mod_xslt.c
  
  Index: mod_xslt.c
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/ApacheModuleXSLT/mod_xslt.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mod_xslt.c	28 Aug 2002 00:36:39 -0000	1.8
  +++ mod_xslt.c	4 Jan 2003 20:28:13 -0000	1.9
  @@ -141,6 +141,9 @@
   
   	XalanHandle xalan = NULL;
   
  +	int i;
  +	int dot_point;
  +
   	int	error = DECLINED;
   
   	CONTROL_STRUCT	control_struct =
  @@ -152,8 +155,27 @@
   	control_struct.r = r;
   
   	mimetype = ap_pstrcat(r->pool, r->filename, NULL);
  +	
  +    /* Find the extension without any assumptions on string.h */
  +	
  +    dot_point = 0;
  +	i = 0;
  +	
  +    while (mimetype[i] != '\0') {
  +        if (mimetype[i] == '.')
  +             dot_point = i;
  +        ++i;
  +    }
  +
  +    if (dot_point == 0) {
  +
  +        fprintf(stderr, "Unable to find extension of : %s\n", mimetype);
  +        r->uri = mimetype;
  +     
  +        return DECLINED;
  +    }
   
  -	filename = ap_getword_nulls_nc(r->pool, &mimetype,'.');
  +    filename = ap_pstrndup(r->pool, r->filename,dot_point);
   
   	xmlfilename = ap_pstrcat(r->pool,filename,".xml",NULL); 
   
  @@ -165,6 +187,10 @@
   
   	if(error)
   	{
  +
  +	    char *msg = XalanGetLastError(xalan);
  +	    fprintf(stderr,"mod_xslt: %s: %s\n", r->filename,msg);
  +
   		r->uri = filename;
   
   		return DECLINED;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message