r45053 - in /trunk/libhtml-template-pro-perl: ./ debian/ lib/HTML/Template/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Wed Sep 30 02:27:47 UTC 2009


Author: jawnsy-guest
Date: Wed Sep 30 02:27:41 2009
New Revision: 45053

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=45053
Log:
New upstream release, should fix FTBFS

Added:
    trunk/libhtml-template-pro-perl/pconst.h
      - copied unchanged from r45052, branches/upstream/libhtml-template-pro-perl/current/pconst.h
Modified:
    trunk/libhtml-template-pro-perl/MANIFEST
    trunk/libhtml-template-pro-perl/META.yml
    trunk/libhtml-template-pro-perl/Makefile.PL
    trunk/libhtml-template-pro-perl/README
    trunk/libhtml-template-pro-perl/builtin_findfile.inc
    trunk/libhtml-template-pro-perl/debian/changelog
    trunk/libhtml-template-pro-perl/getoptint.c
    trunk/libhtml-template-pro-perl/getoptint.re2c
    trunk/libhtml-template-pro-perl/getoptint.re2c.header
    trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm
    trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec
    trunk/libhtml-template-pro-perl/pmiscdef.h
    trunk/libhtml-template-pro-perl/procore.c
    trunk/libhtml-template-pro-perl/procore.h
    trunk/libhtml-template-pro-perl/pstrutils.inc
    trunk/libhtml-template-pro-perl/setoptint.c
    trunk/libhtml-template-pro-perl/setoptint.re2c
    trunk/libhtml-template-pro-perl/setoptint.re2c.header
    trunk/libhtml-template-pro-perl/tags.inc

Modified: trunk/libhtml-template-pro-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/MANIFEST?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/MANIFEST (original)
+++ trunk/libhtml-template-pro-perl/MANIFEST Wed Sep 30 02:27:41 2009
@@ -42,6 +42,7 @@
 parse_expr.h
 pbuffer.c
 pbuffer.h
+pconst.h
 perl-HTML-Template-Pro.spec
 pmiscdef.h
 pparam.h

Modified: trunk/libhtml-template-pro-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/META.yml?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/META.yml (original)
+++ trunk/libhtml-template-pro-perl/META.yml Wed Sep 30 02:27:41 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                HTML-Template-Pro
-version:             0.91
+version:             0.92
 abstract:            Perl/XS module to use HTML Templates from CGI scripts
 license:             perl or LGPL2+
 author:              

Modified: trunk/libhtml-template-pro-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/Makefile.PL?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/Makefile.PL (original)
+++ trunk/libhtml-template-pro-perl/Makefile.PL Wed Sep 30 02:27:41 2009
@@ -25,6 +25,7 @@
 }
 
 my %DEF=(
+    MAINTAINER  => $^O eq 'linux' && -d '.git' ? 1 : 0,
     PCRE  => 1,
     DEBUG => 0,
     MMAP  => 1,
@@ -78,6 +79,7 @@
 );
 
 sub MY::postamble {
+    return '' unless $DEF{MAINTAINER};
     return <<'MAKE_FRAG';
 expr.c: calc.inc exprtool.inc exprpstr.inc
 procore\$(OBJ_EXT): loadfile.inc tagstack.inc

Modified: trunk/libhtml-template-pro-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/README?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/README (original)
+++ trunk/libhtml-template-pro-perl/README Wed Sep 30 02:27:41 2009
@@ -1,4 +1,4 @@
-HTML-Template-Pro version 0.91
+HTML-Template-Pro version 0.92
 ==============================
 
 DESCRIPTION

Modified: trunk/libhtml-template-pro-perl/builtin_findfile.inc
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/builtin_findfile.inc?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/builtin_findfile.inc (original)
+++ trunk/libhtml-template-pro-perl/builtin_findfile.inc Wed Sep 30 02:27:41 2009
@@ -169,7 +169,7 @@
 	}
 	/* old prev_slash_next now current, so we need to recalculate it  */
 	/* first find a 'slash' char */
-	while (!IS_FILE_SEP(*prev_slash_next) && prev_slash_next>=slash_begin) prev_slash_next--;
+	while (prev_slash_next>=slash_begin && !IS_FILE_SEP(*prev_slash_next)) prev_slash_next--;
 	if (prev_slash_next>slash_begin) prev_slash_next++;/* step next to slash */
       } else {
 	prev_slash_next=pos+1;

Modified: trunk/libhtml-template-pro-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/debian/changelog?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/debian/changelog (original)
+++ trunk/libhtml-template-pro-perl/debian/changelog Wed Sep 30 02:27:41 2009
@@ -1,4 +1,4 @@
-libhtml-template-pro-perl (0.91-1) UNRELEASED; urgency=low
+libhtml-template-pro-perl (0.92-1) UNRELEASED; urgency=low
 
   STALLED due to FTBFS; see: https://rt.cpan.org/Ticket/Display.html?id=50016
 
@@ -6,7 +6,7 @@
     + Appears to be minor bugfixes; no changelog entry was recorded
       upstream
 
- -- Jonathan Yu <jawnsy at cpan.org>  Fri, 25 Sep 2009 04:48:52 -0400
+ -- Jonathan Yu <jawnsy at cpan.org>  Tue, 29 Sep 2009 18:39:06 -0400
 
 libhtml-template-pro-perl (0.90-1) unstable; urgency=low
 

Modified: trunk/libhtml-template-pro-perl/getoptint.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/getoptint.c?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/getoptint.c (original)
+++ trunk/libhtml-template-pro-perl/getoptint.c Wed Sep 30 02:27:41 2009
@@ -3,7 +3,7 @@
 #include "pabidecl.h"
 #include "pabstract.h"
 #include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
 
 API_IMPL 
 int

Modified: trunk/libhtml-template-pro-perl/getoptint.re2c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/getoptint.re2c?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/getoptint.re2c (original)
+++ trunk/libhtml-template-pro-perl/getoptint.re2c Wed Sep 30 02:27:41 2009
@@ -1,7 +1,7 @@
 #include "pabidecl.h"
 #include "pabstract.h"
 #include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
 
 API_IMPL 
 int

Modified: trunk/libhtml-template-pro-perl/getoptint.re2c.header
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/getoptint.re2c.header?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/getoptint.re2c.header (original)
+++ trunk/libhtml-template-pro-perl/getoptint.re2c.header Wed Sep 30 02:27:41 2009
@@ -1,7 +1,7 @@
 #include "pabidecl.h"
 #include "pabstract.h"
 #include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
 
 API_IMPL 
 int

Modified: trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm (original)
+++ trunk/libhtml-template-pro-perl/lib/HTML/Template/Pro.pm Wed Sep 30 02:27:41 2009
@@ -12,7 +12,7 @@
 use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
 @ISA = qw(DynaLoader Exporter);
 
-$VERSION = '0.91';
+$VERSION = '0.92';
 
 @EXPORT_OK = qw/ASK_NAME_DEFAULT ASK_NAME_AS_IS ASK_NAME_LOWERCASE ASK_NAME_UPPERCASE ASK_NAME_MASK/;
 %EXPORT_TAGS = (const => [qw/ASK_NAME_DEFAULT ASK_NAME_AS_IS ASK_NAME_LOWERCASE ASK_NAME_UPPERCASE ASK_NAME_MASK/]);

Modified: trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec (original)
+++ trunk/libhtml-template-pro-perl/perl-HTML-Template-Pro.spec Wed Sep 30 02:27:41 2009
@@ -6,7 +6,7 @@
 %define module HTML-Template-Pro
 
 Name: perl-%module
-Version: 0.91
+Version: 0.92
 Release: alt1
 
 Packager: Igor Yu. Vlasenko <viy at altlinux.org>
@@ -54,6 +54,9 @@
 %perl_vendor_man3dir/*
 
 %changelog
+* Tue Sep 29 2009 Igor Vlasenko <viy at altlinux.ru> 0.92-alt1
+- new version; see Changes
+
 * Tue Sep 22 2009 Igor Vlasenko <viy at altlinux.ru> 0.91-alt1
 - new version; see Changes
 

Modified: trunk/libhtml-template-pro-perl/pmiscdef.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/pmiscdef.h?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/pmiscdef.h (original)
+++ trunk/libhtml-template-pro-perl/pmiscdef.h Wed Sep 30 02:27:41 2009
@@ -22,8 +22,8 @@
 # define MOD_TD "%ld"
 #endif
 
-#if ! HAVE_STRDUP && ! defined strdup
-# if HAVE__STRDUP
+#if ! defined HAVE_STRDUP && ! defined strdup
+# if defined HAVE__STRDUP
 #  define strdup _strdup
 # else
 #  define strdup(str) strcpy(malloc(strlen(str) + 1), str)

Modified: trunk/libhtml-template-pro-perl/procore.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/procore.c?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/procore.c (original)
+++ trunk/libhtml-template-pro-perl/procore.c Wed Sep 30 02:27:41 2009
@@ -4,6 +4,7 @@
 #include <ctype.h>
 
 #include "tmplpro.h"
+#include "pconst.h"
 #include "procore.h"
 #include "prostate.h"
 #include "provalue.h"
@@ -84,8 +85,30 @@
   { 0, 0, 0, 0, 0, 0 }, /**/
 };
 
-/* max offset to ensure we are not out of file when try <!--/  */
-#define TAG_WIDTH_OFFSET 4
+typedef void (*tag_handler_func)(struct tmplpro_state *state, const PSTRING* const TagOptVal);
+
+static const tag_handler_func const output_closetag_handler[]={
+  tag_handler_unknown,	/*Bad or unsupported tag*/
+  tag_handler_unknown,	/*VAR*/
+  tag_handler_unknown,	/*INCLUDE*/
+  tag_handler_closeloop,	/*LOOP*/
+  tag_handler_closeif,	/*IF*/
+  tag_handler_unknown,	/*ELSE*/
+  tag_handler_closeunless,	/*UNLESS*/
+  tag_handler_unknown,	/*ELSIF*/
+  tag_handler_unknown,	/**/
+};
+static const tag_handler_func const output_opentag_handler[]={
+  tag_handler_unknown,	/*Bad or unsupported tag*/
+  tag_handler_var,	/*VAR*/
+  tag_handler_include,	/*INCLUDE*/
+  tag_handler_loop,	/*LOOP*/
+  tag_handler_if,	/*IF*/
+  tag_handler_else,	/*ELSE*/
+  tag_handler_unless,	/*UNLESS*/
+  tag_handler_elsif,	/*ELSIF*/
+  tag_handler_unknown,	/**/
+};
 
 static 
 int 
@@ -321,29 +344,16 @@
     (state->param->WriterFuncPtr)(state->param->ext_writer_state,state->last_processed_pos,state->tag_start);
     state->last_processed_pos=state->cur_pos;
   }
-  /* TODO: call tag_specific handler by array of handlers 
-     var_tag_handler(..) */
   if (is_tag_closed) {
-    switch (tag_type) {
-    case HTML_TEMPLATE_TAG_IF:		tag_handler_closeif(state);break;
-    case HTML_TEMPLATE_TAG_UNLESS:	tag_handler_closeunless(state);break;
-    case HTML_TEMPLATE_TAG_LOOP:	tag_handler_closeloop(state);break;
-    default:	tag_handler_unknown(state);break;
-    }
+    output_closetag_handler[tag_type](state,TagOptVal);
   } else {
-    switch (tag_type) {
-    case HTML_TEMPLATE_TAG_VAR:		tag_handler_var(state,TagOptVal); break;
-    case HTML_TEMPLATE_TAG_IF:		tag_handler_if(state,TagOptVal); break;
-    case HTML_TEMPLATE_TAG_UNLESS:	tag_handler_unless(state,TagOptVal); break;
-    case HTML_TEMPLATE_TAG_ELSE:	tag_handler_else(state,TagOptVal); break;
-    case HTML_TEMPLATE_TAG_ELSIF:	tag_handler_elsif(state,TagOptVal); break;
-    case HTML_TEMPLATE_TAG_LOOP:	tag_handler_loop(state,TagOptVal); break;
-    case HTML_TEMPLATE_TAG_INCLUDE:	tag_handler_include(state,TagOptVal);break;
-    default:	tag_handler_unknown(state);break;
-    }
-  }
-}
-
+    output_opentag_handler[tag_type](state,TagOptVal);
+  }
+}
+
+
+/* max offset to ensure we are not out of file when try <!--/  */
+#define TAG_WIDTH_OFFSET 4
 static 
 void 
 process_state (struct tmplpro_state * state)

Modified: trunk/libhtml-template-pro-perl/procore.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/procore.h?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/procore.h (original)
+++ trunk/libhtml-template-pro-perl/procore.h Wed Sep 30 02:27:41 2009
@@ -1,8 +1,3 @@
-#define ERR_PRO_INVALID_ARGUMENT 1
-#define ERR_PRO_FILE_NOT_FOUND 2
-#define ERR_PRO_CANT_OPEN_FILE 3
-#define ERR_PRO_TEMPLATE_SYNTAX_ERROR 4
-
 #include "pstring.h"
 #include "tmpllog.h"
 #include "pabstract.h"

Modified: trunk/libhtml-template-pro-perl/pstrutils.inc
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/pstrutils.inc?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/pstrutils.inc (original)
+++ trunk/libhtml-template-pro-perl/pstrutils.inc Wed Sep 30 02:27:41 2009
@@ -71,10 +71,11 @@
   } else return 1;
 }
 
+#define MAX_ESCAPE_SEQ sizeof("&quot;")
 static 
 PSTRING 
 htmlencode_pstring (pbuffer* StrBuffer, PSTRING pstring) {
-  char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1);
+  char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1+MAX_ESCAPE_SEQ);
   const char* curpos=pstring.begin;
   size_t offset=0;
   size_t buflen=pbuffer_size(StrBuffer);
@@ -82,8 +83,8 @@
   while (curpos<pstring.endnext) {
     unsigned char curchar=*curpos++;
     int bufdelta=1;
-    if (offset>=buflen) {
-      buf=pbuffer_resize(StrBuffer, 2*offset);
+    if (offset>=buflen-MAX_ESCAPE_SEQ) {
+      buf=pbuffer_resize(StrBuffer, 2*(offset+MAX_ESCAPE_SEQ));
       buflen=pbuffer_size(StrBuffer);
     }
     switch (curchar) {
@@ -105,7 +106,7 @@
 static 
 PSTRING 
 jsencode_pstring (pbuffer* StrBuffer, PSTRING pstring) {
-  char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1);
+  char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1+MAX_ESCAPE_SEQ);
   const char* curpos=pstring.begin;
   size_t offset=0;
   size_t buflen=pbuffer_size(StrBuffer);
@@ -113,8 +114,8 @@
   while (curpos<pstring.endnext) {
     unsigned char curchar=*curpos++;
     int bufdelta=1;
-    if (offset>=buflen) {
-      buf=pbuffer_resize(StrBuffer, 2*offset);
+    if (offset>=buflen-MAX_ESCAPE_SEQ) {
+      buf=pbuffer_resize(StrBuffer, 2*(offset+MAX_ESCAPE_SEQ));
       buflen=pbuffer_size(StrBuffer);
     }
     switch (curchar) {
@@ -135,7 +136,7 @@
 static 
 PSTRING 
 urlencode_pstring (pbuffer* StrBuffer, PSTRING pstring) {
-  char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1);
+  char* buf=pbuffer_resize(StrBuffer, pstring.endnext-pstring.begin+1+MAX_ESCAPE_SEQ);
   const char* curpos=pstring.begin;
   size_t offset=0;
   size_t buflen=pbuffer_size(StrBuffer);
@@ -143,8 +144,8 @@
   while (curpos<pstring.endnext) {
     unsigned char curchar=*curpos++;
     int bufdelta=1;
-    if (offset>=buflen) {
-      buf=pbuffer_resize(StrBuffer, 2*offset);
+    if (offset>=buflen-MAX_ESCAPE_SEQ) {
+      buf=pbuffer_resize(StrBuffer, 2*(offset+MAX_ESCAPE_SEQ));
       buflen=pbuffer_size(StrBuffer);
     }
     /* 

Modified: trunk/libhtml-template-pro-perl/setoptint.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/setoptint.c?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/setoptint.c (original)
+++ trunk/libhtml-template-pro-perl/setoptint.c Wed Sep 30 02:27:41 2009
@@ -3,7 +3,7 @@
 #include "pabidecl.h"
 #include "pabstract.h"
 #include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
 
 API_IMPL 
 int

Modified: trunk/libhtml-template-pro-perl/setoptint.re2c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/setoptint.re2c?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/setoptint.re2c (original)
+++ trunk/libhtml-template-pro-perl/setoptint.re2c Wed Sep 30 02:27:41 2009
@@ -1,7 +1,7 @@
 #include "pabidecl.h"
 #include "pabstract.h"
 #include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
 
 API_IMPL 
 int

Modified: trunk/libhtml-template-pro-perl/setoptint.re2c.header
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/setoptint.re2c.header?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/setoptint.re2c.header (original)
+++ trunk/libhtml-template-pro-perl/setoptint.re2c.header Wed Sep 30 02:27:41 2009
@@ -1,7 +1,7 @@
 #include "pabidecl.h"
 #include "pabstract.h"
 #include "pparam.h"
-#include "procore.h"
+#include "pconst.h"
 
 API_IMPL 
 int

Modified: trunk/libhtml-template-pro-perl/tags.inc
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-template-pro-perl/tags.inc?rev=45053&op=diff
==============================================================================
--- trunk/libhtml-template-pro-perl/tags.inc (original)
+++ trunk/libhtml-template-pro-perl/tags.inc Wed Sep 30 02:27:41 2009
@@ -318,7 +318,7 @@
 
 static 
 void 
-tag_handler_closeif (struct tmplpro_state *state)
+tag_handler_closeif (struct tmplpro_state *state, const PSTRING* const TagOptVal)
 {
   struct tagstack_entry iftag;
   if (! test_stack(HTML_TEMPLATE_TAG_IF)) {
@@ -332,7 +332,7 @@
 
 static 
 void 
-tag_handler_closeunless (struct tmplpro_state *state)
+tag_handler_closeunless (struct tmplpro_state *state, const PSTRING* const TagOptVal)
 {
   struct tagstack_entry iftag;
   if (! test_stack(HTML_TEMPLATE_TAG_UNLESS)) {
@@ -468,7 +468,7 @@
 
 static 
 void 
-tag_handler_closeloop (struct tmplpro_state *state)
+tag_handler_closeloop (struct tmplpro_state *state, const PSTRING* const TagOptVal)
 {
   struct tagstack_entry* iftag_ptr;
   if (! test_stack(HTML_TEMPLATE_TAG_LOOP)) {
@@ -492,7 +492,7 @@
 
 static 
 void 
-tag_handler_unknown (struct tmplpro_state *state)
+tag_handler_unknown (struct tmplpro_state *state, const PSTRING* const TagOptVal)
 {
   log_state(state,TMPL_LOG_ERROR,"tag_handler_unknown: unknown tag\n");
 }




More information about the Pkg-perl-cvs-commits mailing list