package gtml

forwarded 340963 
http://sourceforge.net/tracker/index.php?func=detail&aid=1367749&group_id=100737&atid=628148

thanks


Hi Flavio,

Flavio Stanchina wrote:

>Package: gtml
>Version: 3.5.4-1
>Severity: wishlist
>Tags: patch
>
>The #include command will process GTML commands in the input file.
>Therefore, it's not possible to include a file that contains lines
>beginning with # (for example, shell scripts): one would need to alter
>the included file and place a #literal command at the beginning, which
>might not always be an option.
>
>The attached patch adds an #includeliteral command that solves this
>problem. Please apply.
>  
>

Ok. Added. I've modified the patch a little bit to the one included. I
also forwarded upstream.

- Adam

diff -ur gtml-3.5.4-orig/gtml gtml-3.5.4/gtml
--- gtml-3.5.4-orig/gtml        2005-11-27 14:54:06.000000000 -0600
+++ gtml-3.5.4/gtml     2005-11-27 15:08:56.000000000 -0600
@@ -1911,6 +1911,11 @@
         #
         elsif ( /^#include/ )
         {
+            local( $my_prev_literal_setting ) = $literal;
+            if( /^#includeliteral/ )
+            {
+                $literal = 1;
+            }
             chop;
             if ( $compression ) 
             { 
@@ -1918,7 +1923,7 @@
             }
 
             &Substitute();
-            s/^#include[ \t]*"//;
+            s/^#include(literal)?[ \t]*"//;
             s/".*$//; #"
             $file = $_;
             $file = &ResolveIncludeFile($file);
@@ -1928,6 +1933,7 @@
 # TODO #                &Notice("    --- $file\n");
                 &ProcessLines($file);
             }
+            $literal = $my_prev_literal_setting;
             next;
         }
         #
diff -ur gtml-3.5.4-orig/gtml_ref.html gtml-3.5.4/gtml_ref.html
--- gtml-3.5.4-orig/gtml_ref.html       2005-11-27 15:13:27.000000000 -0600
+++ gtml-3.5.4/gtml_ref.html    2005-11-27 15:15:54.000000000 -0600
@@ -82,6 +82,8 @@
 <ul>
   <li><a href="#include"><code>include</code></a>
       - Include the contents of another file.
+  <li><a href="#includeliteral"><code>includeliteral</code></a>
+      - Include contents of another file and turns off GTML processing for 
this file.
   <li><a href="#define"><code>define</code></a> and
       <a href="#newdefine"> <code>newdefine</code></a>
       - Create <em>named constants</em> which can be used as shorthand
@@ -154,6 +156,13 @@
 <p>The directories in which the file may be looked for can be defined in a
 <a href="#searchpath">special</a> named constant.
 
+<!-- --------------- includeliteral ----------------- -->
+
+<a name="includeliteral"></a>
+<h3>#includeliteral</h3>
+
+<p>The same as #include but also turns on #literal so GTML does interpret
+a given file, just includes it.
 
 <!-- -------------------- define -------------------- -->
 

Reply via email to