Explorar el Código

Bug fixes, updates

mingodad hace 10 años
padre
commit
54fc710b23
Se han modificado 8 ficheros con 48 adiciones y 49 borrados
  1. 1 0
      discount/libdiscount.cbp
  2. 1 1
      discount/mkdio.h
  3. 4 2
      discount/version.c
  4. 4 0
      discount/version.c.in
  5. 14 24
      gumbo/README.md
  6. 23 15
      gumbo/parser.c
  7. 0 6
      gumbo/utf8.c
  8. 1 1
      myaxtls/Makefile

+ 1 - 0
discount/libdiscount.cbp

@@ -62,6 +62,7 @@
 			</Target>
 			</Target>
 		</Build>
 		</Build>
 		<Compiler>
 		<Compiler>
+			<Add option='-DVERSION=\\&quot;2.1.2\\&quot;' />
 			<Add directory="G:/c/discount-2.1.2/" />
 			<Add directory="G:/c/discount-2.1.2/" />
 		</Compiler>
 		</Compiler>
 		<Unit filename="Csio.c">
 		<Unit filename="Csio.c">

+ 1 - 1
discount/mkdio.h

@@ -5,7 +5,7 @@
 
 
 typedef void MMIOT;
 typedef void MMIOT;
 
 
-typedef unsigned long mkd_flag_t;
+typedef unsigned int mkd_flag_t;
 
 
 /* line builder for markdown()
 /* line builder for markdown()
  */
  */

+ 4 - 2
discount/version.c

@@ -1,6 +1,8 @@
 #include "config.h"
 #include "config.h"
-
-char markdown_version[] = "2.1.3"
+#ifndef VERSION
+#define VERSION "0.0"
+#endif
+char markdown_version[] = VERSION
 #if 4 != 4
 #if 4 != 4
 		" TAB=4"
 		" TAB=4"
 #endif
 #endif

+ 4 - 0
discount/version.c.in

@@ -1,5 +1,9 @@
 #include "config.h"
 #include "config.h"
 
 
+#ifndef VERSION
+#define VERSION "0.0"
+#endif
+
 char markdown_version[] = VERSION
 char markdown_version[] = VERSION
 #if @TABSTOP@ != 4
 #if @TABSTOP@ != 4
 		" TAB=@TABSTOP@"
 		" TAB=@TABSTOP@"

+ 14 - 24
gumbo/README.md

@@ -46,27 +46,21 @@ Installation
 To build and install the library, issue the standard UNIX incantation from
 To build and install the library, issue the standard UNIX incantation from
 the root of the distribution:
 the root of the distribution:
 
 
-```bash
-$ ./autogen.sh
-$ ./configure
-$ make
-$ sudo make install
-```
+    $ ./autogen.sh
+    $ ./configure
+    $ make
+    $ sudo make install
 
 
 Gumbo comes with full pkg-config support, so you can use the pkg-config to
 Gumbo comes with full pkg-config support, so you can use the pkg-config to
 print the flags needed to link your program against it:
 print the flags needed to link your program against it:
 
 
-```bash
-$ pkg-config --cflags gumbo         # print compiler flags
-$ pkg-config --libs gumbo           # print linker flags
-$ pkg-config --cflags --libs gumbo  # print both
-```
+    $ pkg-config --cflags gumbo         # print compiler flags
+    $ pkg-config --libs gumbo           # print linker flags
+    $ pkg-config --cflags --libs gumbo  # print both
 
 
 For example:
 For example:
 
 
-```bash
-$ gcc my_program.c `pkg-config --cflags --libs gumbo`
-```
+    $ gcc my_program.c `pkg-config --cflags --libs gumbo`
 
 
 See the pkg-config man page for more info.
 See the pkg-config man page for more info.
 
 
@@ -79,22 +73,18 @@ unzipped.  The googletest maintainers recommend against using
 `make install`; instead, symlink the root googletest directory to 'gtest'
 `make install`; instead, symlink the root googletest directory to 'gtest'
 inside gumbo's root directory, and then `make check`:
 inside gumbo's root directory, and then `make check`:
 
 
-```bash
-$ unzip gtest-1.6.0.zip
-$ cd gumbo-*
-$ ln -s ../gtest-1.6.0 gtest
-$ make check
-```
+    $ unzip gtest-1.6.0.zip
+    $ cd gumbo-*
+    $ ln -s ../gtest-1.6.0 gtest
+    $ make check
 
 
 Gumbo's `make check` has code to automatically configure & build gtest and
 Gumbo's `make check` has code to automatically configure & build gtest and
 then link in the library.
 then link in the library.
 
 
 Debian and Fedora users can install libgtest with:
 Debian and Fedora users can install libgtest with:
 
 
-```bash
-$ apt-get install libgtest-dev  # Debian/Ubuntu
-$ yum install gtest-devel       # CentOS/Fedora
-```
+    $ apt-get install libgtest-dev  # Debian/Ubuntu
+    $ yum install gtest-devel       # CentOS/Fedora
 
 
 Note for Ubuntu users: libgtest-dev package only install source files.
 Note for Ubuntu users: libgtest-dev package only install source files.
 You have to make libraries yourself using cmake:
 You have to make libraries yourself using cmake:

+ 23 - 15
gumbo/parser.c

@@ -537,6 +537,25 @@ static bool is_in_static_list(
   return false;
   return false;
 }
 }
 
 
+static void push_template_insertion_mode(
+    GumboParser* parser, GumboInsertionMode mode) {
+  gumbo_vector_add(
+      parser, (void*) mode, &parser->_parser_state->_template_insertion_modes);
+}
+
+static void pop_template_insertion_mode(GumboParser* parser) {
+  gumbo_vector_pop(parser, &parser->_parser_state->_template_insertion_modes);
+}
+
+static GumboInsertionMode get_current_template_insertion_mode(
+    GumboParser* parser) {
+  GumboVector* template_insertion_modes =
+      &parser->_parser_state->_template_insertion_modes;
+  assert(template_insertion_modes->length > 0);
+  return (GumboInsertionMode) template_insertion_modes->data[
+      template_insertion_modes->length - 1];
+}
+
 static void set_insertion_mode(GumboParser* parser, GumboInsertionMode mode) {
 static void set_insertion_mode(GumboParser* parser, GumboInsertionMode mode) {
   parser->_parser_state->_insertion_mode = mode;
   parser->_parser_state->_insertion_mode = mode;
 }
 }
@@ -1716,10 +1735,10 @@ static bool maybe_add_doctype_error(
     GumboParser* parser, const GumboToken* token) {
     GumboParser* parser, const GumboToken* token) {
   const GumboTokenDocType* doctype = &token->v.doc_type;
   const GumboTokenDocType* doctype = &token->v.doc_type;
   bool html_doctype = !strcmp(doctype->name, kDoctypeHtml.data);
   bool html_doctype = !strcmp(doctype->name, kDoctypeHtml.data);
-  if ((!html_doctype ||
-       doctype->has_public_identifier ||
-       (doctype->has_system_identifier && !strcmp(
-          doctype->system_identifier, kSystemIdLegacyCompat.data))) &&
+  if (!html_doctype ||
+      doctype->has_public_identifier ||
+      (doctype->has_system_identifier && !strcmp(
+          doctype->system_identifier, kSystemIdLegacyCompat.data)) ||
       !(html_doctype && (
       !(html_doctype && (
           doctype_matches(doctype, &kPublicIdHtml4_0,
           doctype_matches(doctype, &kPublicIdHtml4_0,
                           &kSystemIdRecHtml4_0, true) ||
                           &kSystemIdRecHtml4_0, true) ||
@@ -2353,13 +2372,6 @@ static bool handle_in_body(GumboParser* parser, GumboToken* token) {
       node = pop_current_node(parser);
       node = pop_current_node(parser);
     } while (node != state->_open_elements.data[1]);
     } while (node != state->_open_elements.data[1]);
 
 
-    // Removing & destroying the body node is going to kill any nodes that have
-    // been added to the list of active formatting elements, and so we should
-    // clear it to prevent a use-after-free if the list of active formatting
-    // elements is reconstructed afterwards.  This may happen if whitespace
-    // follows the </frameset>.
-    clear_active_formatting_elements(parser);
-
     // Remove the body node.  We may want to factor this out into a generic
     // Remove the body node.  We may want to factor this out into a generic
     // helper, but right now this is the only code that needs to do this.
     // helper, but right now this is the only code that needs to do this.
     GumboVector* children = &parser->_output->root->v.element.children;
     GumboVector* children = &parser->_output->root->v.element.children;
@@ -3531,10 +3543,6 @@ static bool handle_after_frameset(GumboParser* parser, GumboToken* token) {
   } else if (tag_is(token, kStartTag, GUMBO_TAG_HTML)) {
   } else if (tag_is(token, kStartTag, GUMBO_TAG_HTML)) {
     return handle_in_body(parser, token);
     return handle_in_body(parser, token);
   } else if (tag_is(token, kEndTag, GUMBO_TAG_HTML)) {
   } else if (tag_is(token, kEndTag, GUMBO_TAG_HTML)) {
-    GumboNode* html = parser->_parser_state->_open_elements.data[0];
-    assert(node_tag_is(html, GUMBO_TAG_HTML));
-    record_end_of_element(
-        parser->_parser_state->_current_token, &html->v.element);
     set_insertion_mode(parser, GUMBO_INSERTION_MODE_AFTER_AFTER_FRAMESET);
     set_insertion_mode(parser, GUMBO_INSERTION_MODE_AFTER_AFTER_FRAMESET);
     return true;
     return true;
   } else if (tag_is(token, kStartTag, GUMBO_TAG_NOFRAMES)) {
   } else if (tag_is(token, kStartTag, GUMBO_TAG_NOFRAMES)) {

+ 0 - 6
gumbo/utf8.c

@@ -208,12 +208,6 @@ void utf8iterator_init(
 }
 }
 
 
 void utf8iterator_next(Utf8Iterator* iter) {
 void utf8iterator_next(Utf8Iterator* iter) {
-  if (iter->_current == -1) {
-    // If we're already at EOF, bail out before advancing anything to avoid
-    // reading past the end of the buffer.  It's easier to catch this case here
-    // than litter the code with lots of individual checks for EOF.
-    return;
-  }
   iter->_start += iter->_width;
   iter->_start += iter->_width;
   // We update positions based on the *last* character read, so that the first
   // We update positions based on the *last* character read, so that the first
   // character following a newline is at column 1 in the next line.
   // character following a newline is at column 1 in the next line.

+ 1 - 1
myaxtls/Makefile

@@ -1,7 +1,7 @@
 CFLAGS = -O3 -DSSL_STATIC_LIBRARY=1 -DAXTLS_LIBRARY=1 -DAS_STATIC_LIB=1 -DCONFIG_OPENSSL_COMPATIBLE=1
 CFLAGS = -O3 -DSSL_STATIC_LIBRARY=1 -DAXTLS_LIBRARY=1 -DAS_STATIC_LIB=1 -DCONFIG_OPENSSL_COMPATIBLE=1
 
 
 SOURCES= aes.c asn1.c bigint.c crypto_misc.c gen_cert.c hmac.c \
 SOURCES= aes.c asn1.c bigint.c crypto_misc.c gen_cert.c hmac.c \
-    loader.c md2.c md5.c openssl.c os_port.c p12.c rc4.c \
+    loader.c sha256.c md5.c openssl.c os_port.c p12.c rc4.c \
     rsa.c sha1.c tls1.c tls1_clnt.c tls1_svr.c x509.c
     rsa.c sha1.c tls1.c tls1_clnt.c tls1_svr.c x509.c
 
 
 OBJECTS = $(SOURCES:.c=.o)
 OBJECTS = $(SOURCES:.c=.o)