[SCM] tinyows branch, master, updated. debian/0.9.0-2-40-g0ce88fb
Bas Couwenberg
sebastic at xs4all.nl
Thu Sep 19 00:08:54 UTC 2013
The following commit has been merged in the master branch:
commit 911e5719c591d9186476c23fb9e75f89350911e7
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Mon Jul 22 00:25:06 2013 +0200
Correct buffer_copy.patch origin, simplify patch.
diff --git a/debian/changelog b/debian/changelog
index 1cbbf90..0e3f248 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,7 @@ tinyows (1.1.0-3) UNRELEASED; urgency=low
* Remove autogenerated files on clean.
* Suggest MapServer (cgi-mapserver) and MapCache (libapache2-mod-mapcache).
* Recommend PostGIS for PostgreSQL 9.1 (postgresql-9.1-postgis).
+ * Correct buffer_copy.patch origin, simplify patch.
-- Bas Couwenberg <sebastic at xs4all.nl> Sun, 21 Jul 2013 15:37:59 +0200
diff --git a/debian/patches/buffer_copy.patch b/debian/patches/buffer_copy.patch
index 76986de..da73c50 100644
--- a/debian/patches/buffer_copy.patch
+++ b/debian/patches/buffer_copy.patch
@@ -1,141 +1,27 @@
Description: Fix for buffer_copy when loading config from mapfile.
-Author: Jerome Villeneuve Larouche <jlarouche at mapgears.com>
-Last-Update: 2013-03-28
---- a/src/mapfile/mapfile.c
-+++ b/src/mapfile/mapfile.c
-@@ -34,7 +34,7 @@
- #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
- /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
-- * if you want the limit (max/min) macros for int types.
-+ * if you want the limit (max/min) macros for int types.
- */
- #ifndef __STDC_LIMIT_MACROS
- #define __STDC_LIMIT_MACROS 1
-@@ -51,7 +51,7 @@
- typedef signed char flex_int8_t;
- typedef short int flex_int16_t;
- typedef int flex_int32_t;
--typedef unsigned char flex_uint8_t;
-+typedef unsigned char flex_uint8_t;
- typedef unsigned short int flex_uint16_t;
- typedef unsigned int flex_uint32_t;
- #endif /* ! C99 */
-@@ -167,7 +167,7 @@
- #define EOB_ACT_LAST_MATCH 2
-
- #define YY_LESS_LINENO(n)
--
-+
- /* Return all but the first "n" matched characters back to the input stream. */
- #define yyless(n) \
- do \
-@@ -224,7 +224,7 @@
-
- int yy_bs_lineno; /**< The line count. */
- int yy_bs_column; /**< The column count. */
--
-+
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
-@@ -1065,14 +1065,14 @@
- #if 0
- #define OWS_MAP_DBG fprintf(stderr, "State: {%i} %i \n", yy_top_state(), YY_START);
- #else
--#define OWS_MAP_DBG
-+#define OWS_MAP_DBG
- #endif
-
-
- static buffer * mapfile_build_path(ows * o, char * fpath)
- {
- buffer * path;
--
-+
- assert(fpath);
-
- /* Path is absolute */
-@@ -1083,9 +1083,9 @@
- path = buffer_init();
- buffer_copy(path, o->config_file);
-
-- for ( /* empty */ ; path->use ; path->use--)
-- if ((path->buf[path->use] == '/') || (path->buf[path->use] == '\\')) { path->use++ ; break; }
--
-+ for ( /* empty */ ; path->use ; path->use--)
-+ if ((path->buf[path->use] == '/') || (path->buf[path->use] == '\\')) { path->use++ ; break; }
-+
- buffer_add_str(path, fpath);
-
- return path;
-@@ -1162,11 +1162,11 @@
- enum map_layer_prop_state {
- MAP_LAYER_NAME,
- MAP_LAYER_CONNECTION
--
-+
- };
+Origin: https://github.com/mapserver/tinyows/issues/58
+Author: Pirmin Kalberer <pi_deb at sourcepole.ch>
+Last-Update: 2013-03-08
+--- a/src/mapfile/mapfile.l
++++ b/src/mapfile/mapfile.l
+@@ -539,12 +539,14 @@ static void end_layer()
+ buffer_add_str(map_l->storage->schema, "public");
+ if (!map_is_dump) map_l->retrievable=map_l->writable = false;
- /*
-- * Global Vars
-+ * Global Vars
- */
- ows *map_o = NULL;
- ows_layer *map_l = NULL;
-@@ -1272,7 +1272,7 @@
- int i;
- char *p;
- ows_geobbox *g;
--
-+
- /* remove surrounding quotes */
- if (quotes) {
- for (p = yytext; *p ; p++); *(--p) = 0; yytext++;
-@@ -1284,20 +1284,20 @@
- case MAP_MD_UPDATESEQUENCE: return; /* TODO */
- case MAP_MD_SCHEMAS_LOCATION: return; /* TODO */
- case MAP_MD_FEATURE_COLLECTION: return; /* TODO */
-- case MAP_MD_ABSTRACT:
-+ case MAP_MD_ABSTRACT:
- map_o->metadata->abstract = buffer_init();
- buffer_add_str(map_o->metadata->abstract, yytext);
- return;
- case MAP_MD_ACCESSCONSTRAINTS:
- map_o->metadata->access_constraints = buffer_init();
-- buffer_add_str(map_o->metadata->access_constraints, yytext);
-+ buffer_add_str(map_o->metadata->access_constraints, yytext);
- return;
- case MAP_MD_ENCODING:
-- buffer_add_str(map_o->encoding, yytext);
-+ buffer_add_str(map_o->encoding, yytext);
- return;
- case MAP_MD_FEES:
- map_o->metadata->fees = buffer_init();
-- buffer_add_str(map_o->metadata->fees, yytext);
-+ buffer_add_str(map_o->metadata->fees, yytext);
- return;
- case MAP_MD_KEYWORDLIST:
- map_o->metadata->keywords = list_explode_str(',', yytext);
-@@ -1494,7 +1494,7 @@
- buffer_add_str(map_l->ns_prefix, yytext);
- if (map_l->name->use) {
- buffer_add_head(map_l->name, ':');
-- buffer_add_head_str(map_l->name, yytext);
-+ buffer_add_head_str(map_l->name, yytext);
++ map_l->name_prefix = buffer_init();
+ buffer_copy(map_l->name_prefix, map_l->name);
+ if (map_l->ns_prefix->use) {
+ buffer_add_head(map_l->name_prefix, ':');
+ buffer_add_head_str(map_l->name_prefix, map_l->ns_prefix->buf);
}
- return;
- case MAP_LMD_SRS:
-@@ -1549,7 +1549,7 @@
- buffer_add_str(map_o->metadata->name, yytext);
- return;
- }
--
-+
- }
- static void layer_properties(char * yytext, bool quotes)
-@@ -1588,12 +1588,14 @@
++ map_l->name_no_uri = buffer_init();
+ buffer_copy(map_l->name_no_uri, map_l->name);
+ if (map_l->ns_uri->use) {
+ buffer_add_head(map_l->name, ':');
+--- a/src/mapfile/mapfile.c
++++ b/src/mapfile/mapfile.c
+@@ -1588,12 +1588,14 @@ static void end_layer()
buffer_add_str(map_l->storage->schema, "public");
if (!map_is_dump) map_l->retrievable=map_l->writable = false;
@@ -150,407 +36,3 @@ Last-Update: 2013-03-28
buffer_copy(map_l->name_no_uri, map_l->name);
if (map_l->ns_uri->use) {
buffer_add_head(map_l->name, ':');
-@@ -1602,7 +1604,7 @@
-
- ows_layer_list_add(map_o->layers, map_l);
- }
--
-+
- map_is_dump = map_is_postgis = false;
- }
-
-@@ -1743,13 +1745,13 @@
- static int yy_start_stack_ptr = 0;
- static int yy_start_stack_depth = 0;
- static int *yy_start_stack = NULL;
--
-+
- static void yy_push_state (int new_state );
--
-+
- static void yy_pop_state (void );
--
-+
- static int yy_top_state (void );
--
-+
- /* Amount of stuff to slurp up with each read. */
- #ifndef YY_READ_BUF_SIZE
- #define YY_READ_BUF_SIZE 8192
-@@ -1852,7 +1854,7 @@
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
--
-+
- #line 598 "src/mapfile/mapfile.l"
-
-
-@@ -1954,9 +1956,9 @@
- case 4:
- YY_RULE_SETUP
- #line 607 "src/mapfile/mapfile.l"
--{
-+{
- OWS_MAP_EATLINE
-- if (yy_top_state() == INITIAL && YY_START != MAP) {
-+ if (yy_top_state() == INITIAL && YY_START != MAP) {
- ows_error(map_o, OWS_ERROR_CONFIG_FILE,
- "MapFile Parse Error", "parse_config_file");
- yyterminate();}
-@@ -2446,7 +2448,7 @@
- #line 715 "src/mapfile/mapfile.l"
- {
-
-- char *p, *q;
-+ char *p, *q;
- buffer *path;
-
- yy_pop_state(); OWS_MAP_DBG
-@@ -2483,7 +2485,7 @@
- case 101:
- YY_RULE_SETUP
- #line 747 "src/mapfile/mapfile.l"
--{properties(yytext, false); BEGIN MAP;}
-+{properties(yytext, false); BEGIN MAP;}
- YY_BREAK
- case 102:
- /* rule 102 can match eol */
-@@ -2494,7 +2496,7 @@
- case 103:
- YY_RULE_SETUP
- #line 749 "src/mapfile/mapfile.l"
--{layer_properties(yytext, false); BEGIN LAYER;}
-+{layer_properties(yytext, false); BEGIN LAYER;}
- YY_BREAK
- case 104:
- /* rule 104 can match eol */
-@@ -2543,17 +2545,17 @@
- case YY_STATE_EOF(POINTS):
- case YY_STATE_EOF(INCLUDE):
- #line 754 "src/mapfile/mapfile.l"
--{
-+{
- /* End of main file */
-- if (map_include_stack_ptr == 0 && YY_START == 0) yyterminate();
--
-+ if (map_include_stack_ptr == 0 && YY_START == 0) yyterminate();
-+
- else if (map_include_stack_ptr) {
- fclose(YY_CURRENT_BUFFER->yy_input_file);
- yy_delete_buffer(YY_CURRENT_BUFFER );
- yy_switch_to_buffer(map_include_stack[--map_include_stack_ptr]);
- } else {
- ows_error(map_o, OWS_ERROR_CONFIG_FILE, "MapFile parse error",
-- "parse_config_file");
-+ "parse_config_file");
- yyterminate();
- }
- }
-@@ -2840,7 +2842,7 @@
- {
- register yy_state_type yy_current_state;
- register char *yy_cp;
--
-+
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-@@ -2900,7 +2902,7 @@
-
- {
- int c;
--
-+
- *(yy_c_buf_p) = (yy_hold_char);
-
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-@@ -2967,12 +2969,12 @@
-
- /** Immediately switch to a different input stream.
- * @param input_file A readable stream.
-- *
-+ *
- * @note This function does not reset the start condition to @c INITIAL .
- */
- void yyrestart (FILE * input_file )
- {
--
-+
- if ( ! YY_CURRENT_BUFFER ){
- yyensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
-@@ -2985,11 +2987,11 @@
-
- /** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
-- *
-+ *
- */
- void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
- {
--
-+
- /* TODO. We should be able to replace this entire function body
- * with
- * yypop_buffer_state();
-@@ -3029,13 +3031,13 @@
- /** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
-- *
-+ *
- * @return the allocated buffer state.
- */
- YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
- {
- YY_BUFFER_STATE b;
--
-+
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-@@ -3058,11 +3060,11 @@
-
- /** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
-- *
-+ *
- */
- void yy_delete_buffer (YY_BUFFER_STATE b )
- {
--
-+
- if ( ! b )
- return;
-
-@@ -3083,7 +3085,7 @@
-
- {
- int oerrno = errno;
--
-+
- yy_flush_buffer(b );
-
- b->yy_input_file = file;
-@@ -3099,13 +3101,13 @@
- }
-
- b->yy_is_interactive = 0;
--
-+
- errno = oerrno;
- }
-
- /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
-- *
-+ *
- */
- void yy_flush_buffer (YY_BUFFER_STATE b )
- {
-@@ -3134,7 +3136,7 @@
- * the current state. This function will allocate the stack
- * if necessary.
- * @param new_buffer The new state.
-- *
-+ *
- */
- void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
- {
-@@ -3164,7 +3166,7 @@
-
- /** Removes and deletes the top of the stack, if present.
- * The next element becomes the new top.
-- *
-+ *
- */
- void yypop_buffer_state (void)
- {
-@@ -3188,7 +3190,7 @@
- static void yyensure_buffer_stack (void)
- {
- yy_size_t num_to_alloc;
--
-+
- if (!(yy_buffer_stack)) {
-
- /* First allocation is just for 2 elements, since we don't know if this
-@@ -3201,9 +3203,9 @@
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
--
-+
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
--
-+
- (yy_buffer_stack_max) = num_to_alloc;
- (yy_buffer_stack_top) = 0;
- return;
-@@ -3231,13 +3233,13 @@
- /** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
-- *
-- * @return the newly allocated buffer state object.
-+ *
-+ * @return the newly allocated buffer state object.
- */
- YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
- {
- YY_BUFFER_STATE b;
--
-+
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
-@@ -3266,14 +3268,14 @@
- /** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
-- *
-+ *
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- * yy_scan_bytes() instead.
- */
- YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
- {
--
-+
- return yy_scan_bytes(yystr,strlen(yystr) );
- }
-
-@@ -3281,7 +3283,7 @@
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
-- *
-+ *
- * @return the newly allocated buffer state object.
- */
- YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
-@@ -3289,7 +3291,7 @@
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n, i;
--
-+
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) yyalloc(n );
-@@ -3380,16 +3382,16 @@
- /* Accessor methods (get/set functions) to struct members. */
-
- /** Get the current line number.
-- *
-+ *
- */
- int yyget_lineno (void)
- {
--
-+
- return yylineno;
- }
-
- /** Get the input stream.
-- *
-+ *
- */
- FILE *yyget_in (void)
- {
-@@ -3397,7 +3399,7 @@
- }
-
- /** Get the output stream.
-- *
-+ *
- */
- FILE *yyget_out (void)
- {
-@@ -3405,7 +3407,7 @@
- }
-
- /** Get the length of the current token.
-- *
-+ *
- */
- yy_size_t yyget_leng (void)
- {
-@@ -3413,7 +3415,7 @@
- }
-
- /** Get the current token.
-- *
-+ *
- */
-
- char *yyget_text (void)
-@@ -3423,18 +3425,18 @@
-
- /** Set the current line number.
- * @param line_number
-- *
-+ *
- */
- void yyset_lineno (int line_number )
- {
--
-+
- yylineno = line_number;
- }
-
- /** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
-- *
-+ *
- * @see yy_switch_to_buffer
- */
- void yyset_in (FILE * in_str )
-@@ -3492,7 +3494,7 @@
- /* yylex_destroy is for both reentrant and non-reentrant scanners. */
- int yylex_destroy (void)
- {
--
-+
- /* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- yy_delete_buffer(YY_CURRENT_BUFFER );
-@@ -3575,7 +3577,7 @@
- assert(filename);
-
- if (!(yyin = fopen(filename, "r"))) {
-- ows_error(o, OWS_ERROR_CONFIG_FILE, "Unable to open MapFile !",
-+ ows_error(o, OWS_ERROR_CONFIG_FILE, "Unable to open MapFile !",
- "parse_config_file");
- return;
- }
-@@ -3588,7 +3590,7 @@
-
- if (!map_o->encoding->use) buffer_add_str(map_o->encoding, OWS_DEFAULT_XML_ENCODING);
- if (!map_o->db_encoding->use) buffer_add_str(map_o->db_encoding, OWS_DEFAULT_DB_ENCODING);
--
-+
- if (map_srid) {
- for (ln = o->layers->first ; ln ; ln = ln->next)
- list_add_list(ln->layer->srid, map_srid);
-@@ -3598,14 +3600,14 @@
- if (map_ns_uri) {
- for (ln = o->layers->first ; ln ; ln = ln->next)
- if (!ln->layer->ns_uri->use)
-- buffer_copy(ln->layer->ns_uri, map_ns_uri);
-+ buffer_copy(ln->layer->ns_uri, map_ns_uri);
- buffer_free(map_ns_uri);
- }
--
-+
- if (map_ns_prefix) {
- for (ln = o->layers->first ; ln ; ln = ln->next)
- if (!ln->layer->ns_prefix->use)
-- buffer_copy(ln->layer->ns_prefix, map_ns_prefix);
-+ buffer_copy(ln->layer->ns_prefix, map_ns_prefix);
- buffer_free(map_ns_prefix);
- }
-
--
A simple WFS-T server
More information about the Pkg-grass-devel
mailing list