Tracker: Patches

5 <include> and relative paths - ID: 621655
Last Update: Comment added ( ddekany )

When a template called "/foo/bar/template.fm" has the
directive:

<include "header.fm">

the freemarker code will try to include the file
"/foo/header.fm" rather than "/foo/bar/header.fm". I
think this might be a mistake. This will fix it:

---
freemarker-2.1RC1/src/freemarker/template/Include.java
Sun Sep 29 06:33:28 2002
+++ freemarker/src/freemarker/template/Include.java Thu
Oct 10 17:37:09 2002@@ -86,7 +86,7 @@
{
super.setLocation(template, beginColumn,
beginLine, endColumn, endLine);
templatePath = template.getName();
- int lastSlash = templatePath.indexOf('/');
+ int lastSlash = templatePath.lastIndexOf('/');
templatePath = lastSlash == -1 ? "" :
templatePath.substring(0, lastSlash + 1);
}


Nobody/Anonymous ( nobody ) - 2002-10-10 17:43:41 PDT

5

Closed

Accepted

Dániel Dékány

None

None

Public


Comment ( 1 )

Date: 2002-10-11 18:46:41 PDT
Sender: ddekanyProject Admin

Logged In: YES
user_id=546667

Thank you! Fixed in the CVS. Will be released with FM 2.1 RC2.


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2002-10-11 18:46:41 PDT ddekany
resolution_id None 2002-10-11 18:46:41 PDT ddekany
assigned_to nobody 2002-10-11 18:46:41 PDT ddekany
close_date - 2002-10-11 18:46:41 PDT ddekany