tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lar...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler JspReader.java
Date Mon, 28 Aug 2000 02:48:05 GMT
larryi      00/08/27 19:48:05

  Modified:    src/share/org/apache/jasper/compiler Tag: tomcat_32
                        JspReader.java
  Log:
  Apply fix for "relative nested includes" to tomcat_32 branch.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.16.2.3  +12 -9     jakarta-tomcat/src/share/org/apache/jasper/compiler/JspReader.java
  
  Index: JspReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspReader.java,v
  retrieving revision 1.16.2.2
  retrieving revision 1.16.2.3
  diff -u -r1.16.2.2 -r1.16.2.3
  --- JspReader.java	2000/07/23 18:58:02	1.16.2.2
  +++ JspReader.java	2000/08/28 02:48:05	1.16.2.3
  @@ -141,13 +141,13 @@
               null : master.substring(0, master.lastIndexOf("/") + 1);
           boolean isAbsolute = name.startsWith("/");
   
  -        if (parent == null || isAbsolute)
  -            pushFile(new File(name), encoding);
  -        else
  -            pushFile(new File(parent + name), encoding);
  -
  -        if (master == null)
  +        if (parent == null || isAbsolute) {
               master = name;
  +            pushFile(new File(name), encoding);
  +        } else {
  +            master = parent + name;
  +            pushFile(new File(master), encoding);
  +        }
       }
   
       /**
  @@ -205,10 +205,10 @@
   	    caw.close();
   	    if (current == null) {
   		current = new Mark( this, caw.toCharArray(), fileid, getFile(fileid),
  -				    file.getParent(), encoding );
  +				    master, encoding );
   	    } else {
   		current.pushStream( caw.toCharArray(), fileid, getFile(fileid),
  -				    file.getParent(), encoding );
  +				    master, encoding );
   	    }
   
           } catch (FileNotFoundException fnfe) {
  @@ -241,7 +241,10 @@
   		(Constants.getString("jsp.error.file.not.registered",
   				     new Object[] {fName}));
   
  -	return current.popStream();
  +	boolean r = current.popStream();
  +	if (r)
  +		master = current.baseDir;
  +	return r;
       }
   	
       protected JspReader(String file, JspCompilationContext ctx, String encoding) 
  
  
  

Mime
View raw message