diff options
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | generic/tclLoad.c | 6 | ||||
-rw-r--r-- | generic/tclParse.c | 14 | ||||
-rw-r--r-- | generic/tclParse.h | 17 | ||||
-rw-r--r-- | generic/tclUtil.c | 33 | ||||
-rw-r--r-- | library/http/http.tcl | 6 | ||||
-rw-r--r-- | library/http/pkgIndex.tcl | 2 | ||||
-rw-r--r-- | tests/http.test | 12 | ||||
-rw-r--r-- | unix/Makefile.in | 9 | ||||
-rwxr-xr-x | unix/configure | 3 | ||||
-rw-r--r-- | unix/tcl.m4 | 3 | ||||
-rw-r--r-- | win/Makefile.in | 4 | ||||
-rw-r--r-- | win/tclWinPort.h | 6 |
13 files changed, 90 insertions, 43 deletions
@@ -1,3 +1,21 @@ +2012-03-07 Andreas Kupries <andreask@activestate.com> + + * library/http/http.tcl: [Bug 3498327]: Generate upper-case + * library/http/pkgIndex.tcl: hexadecimal output for compliance + * tests/http.test: with RFC 3986. Bumped version to 2.8.4. + * unix/Makefile.in: + * win/Makefile.in: + +2012-03-06 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tclWinPort.h: Compatibility with older Visual Studio versions. + +2012-03-04 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tclLoad.c: Patch from the cygwin folks + * unix/tcl.m4: + * unix/configure: (re-generated) + 2012-03-02 Donal K. Fellows <dkf@users.sf.net> * generic/tclBinary.c (Tcl_SetByteArrayObj): [Bug 3496014]: Only zero diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 820707e..202e66a 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -305,6 +305,12 @@ Tcl_LoadObjCmd( && (pkgGuess[2] == 'b')) { pkgGuess += 3; } +#ifdef __CYGWIN__ + if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y') + && (pkgGuess[2] == 'g')) { + pkgGuess += 3; + } +#endif /* __CYGWIN__ */ for (p = pkgGuess; *p != 0; p += offset) { offset = Tcl_UtfToUniChar(p, &ch); if ((ch > 0x100) diff --git a/generic/tclParse.c b/generic/tclParse.c index 3c984bf..f0050c6 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -14,6 +14,7 @@ */ #include "tclInt.h" +#include "tclParse.h" /* * The following table provides parsing information about each possible 8-bit @@ -41,18 +42,7 @@ * TYPE_BRACE - Character is a curly brace (either left or right). */ -#define TYPE_NORMAL 0 -#define TYPE_SPACE 0x1 -#define TYPE_COMMAND_END 0x2 -#define TYPE_SUBS 0x4 -#define TYPE_QUOTE 0x8 -#define TYPE_CLOSE_PAREN 0x10 -#define TYPE_CLOSE_BRACK 0x20 -#define TYPE_BRACE 0x40 - -#define CHAR_TYPE(c) (charTypeTable+128)[(int)(c)] - -static const char charTypeTable[] = { +const char charTypeTable[] = { /* * Negative character values, from -128 to -1: */ diff --git a/generic/tclParse.h b/generic/tclParse.h new file mode 100644 index 0000000..be1ab15 --- /dev/null +++ b/generic/tclParse.h @@ -0,0 +1,17 @@ +/* + * Minimal set of shared macro definitions and declarations so that multiple + * source files can make use of the parsing table in tclParse.c + */ + +#define TYPE_NORMAL 0 +#define TYPE_SPACE 0x1 +#define TYPE_COMMAND_END 0x2 +#define TYPE_SUBS 0x4 +#define TYPE_QUOTE 0x8 +#define TYPE_CLOSE_PAREN 0x10 +#define TYPE_CLOSE_BRACK 0x20 +#define TYPE_BRACE 0x40 + +#define CHAR_TYPE(c) (charTypeTable+128)[(int)(c)] + +MODULE_SCOPE const char charTypeTable[]; diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 31c9fd3..6ce430b 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -13,6 +13,7 @@ */ #include "tclInt.h" +#include "tclParse.h" #include <math.h> /* @@ -972,15 +973,16 @@ TclScanElement( } while (length) { + if (CHAR_TYPE(*p) != TYPE_NORMAL) { switch (*p) { - case '{': + case '{': /* TYPE_BRACE */ #if COMPAT braceCount++; #endif extra++; /* Escape '{' => '\{' */ nestingLevel++; break; - case '}': + case '}': /* TYPE_BRACE */ #if COMPAT braceCount++; #endif @@ -991,8 +993,8 @@ TclScanElement( requireEscape = 1; } break; - case ']': - case '"': + case ']': /* TYPE_CLOSE_BRACK */ + case '"': /* TYPE_SPACE */ #if COMPAT forbidNone = 1; extra++; /* Escapes all just prepend a backslash */ @@ -1001,22 +1003,22 @@ TclScanElement( #else /* FLOW THROUGH */ #endif - case '[': - case '$': - case ';': - case ' ': - case '\f': - case '\n': - case '\r': - case '\t': - case '\v': + case '[': /* TYPE_SUBS */ + case '$': /* TYPE_SUBS */ + case ';': /* TYPE_COMMAND_END */ + case ' ': /* TYPE_SPACE */ + case '\f': /* TYPE_SPACE */ + case '\n': /* TYPE_COMMAND_END */ + case '\r': /* TYPE_SPACE */ + case '\t': /* TYPE_SPACE */ + case '\v': /* TYPE_SPACE */ forbidNone = 1; extra++; /* Escape sequences all one byte longer. */ #if COMPAT preferBrace = 1; #endif break; - case '\\': + case '\\': /* TYPE_SUBS */ extra++; /* Escape '\' => '\\' */ if ((length == 1) || ((length == -1) && (p[1] == '\0'))) { /* Final backslash. Cannot format with brace quoting. */ @@ -1041,13 +1043,14 @@ TclScanElement( preferBrace = 1; #endif break; - case '\0': + case '\0': /* TYPE_SUBS */ if (length == -1) { goto endOfString; } /* TODO: Panic on improper encoding? */ break; } + } length -= (length > 0); p++; } diff --git a/library/http/http.tcl b/library/http/http.tcl index 6f0f4ce..b5ce82b 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -11,7 +11,7 @@ package require Tcl 8.6 # Keep this in sync with pkgIndex.tcl and with the install directories in # Makefiles -package provide http 2.8.3 +package provide http 2.8.4 namespace eval http { # Allow resourcing to not clobber existing data @@ -43,11 +43,11 @@ namespace eval http { for {set i 0} {$i <= 256} {incr i} { set c [format %c $i] if {![string match {[-._~a-zA-Z0-9]} $c]} { - set map($c) %[format %.2x $i] + set map($c) %[format %.2X $i] } } # These are handled specially - set map(\n) %0d%0a + set map(\n) %0D%0A variable formMap [array get map] # Create a map for HTTP/1.1 open sockets diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index d89b14b..d51f8a8 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -1,2 +1,2 @@ if {![package vsatisfies [package provide Tcl] 8.6]} {return} -package ifneeded http 2.8.3 [list tclPkgSetup $dir http 2.8.3 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.8.4 [list tclPkgSetup $dir http 2.8.4 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] diff --git a/tests/http.test b/tests/http.test index d9c1efb..37d4a05 100644 --- a/tests/http.test +++ b/tests/http.test @@ -555,17 +555,17 @@ test http-5.1 {http::formatQuery} { # test http-5.2 obsoleted by 5.4 and 5.5 with http 2.5 test http-5.3 {http::formatQuery} { http::formatQuery lines "line1\nline2\nline3" -} {lines=line1%0d%0aline2%0d%0aline3} +} {lines=line1%0D%0Aline2%0D%0Aline3} test http-5.4 {http::formatQuery} { http::formatQuery name1 ~bwelch name2 \xa1\xa2\xa2 -} {name1=~bwelch&name2=%c2%a1%c2%a2%c2%a2} +} {name1=~bwelch&name2=%C2%A1%C2%A2%C2%A2} test http-5.5 {http::formatQuery} { set enc [http::config -urlencoding] http::config -urlencoding iso8859-1 set res [http::formatQuery name1 ~bwelch name2 \xa1\xa2\xa2] http::config -urlencoding $enc set res -} {name1=~bwelch&name2=%a1%a2%a2} +} {name1=~bwelch&name2=%A1%A2%A2} test http-6.1 {http::ProxyRequired} -body { http::config -proxyhost [info hostname] -proxyport $port @@ -583,12 +583,12 @@ test http-6.1 {http::ProxyRequired} -body { test http-7.1 {http::mapReply} { http::mapReply "abc\$\[\]\"\\()\}\{" -} {abc%24%5b%5d%22%5c%28%29%7d%7b} +} {abc%24%5B%5D%22%5C%28%29%7D%7B} test http-7.2 {http::mapReply} { # RFC 2718 specifies that we pass urlencoding on utf-8 chars by default, # so make sure this gets converted to utf-8 then urlencoded. http::mapReply "\u2208" -} {%e2%88%88} +} {%E2%88%88} test http-7.3 {http::formatQuery} -setup { set enc [http::config -urlencoding] } -returnCodes error -body { @@ -607,7 +607,7 @@ test http-7.4 {http::formatQuery} -setup { http::mapReply "\u2208" } -cleanup { http::config -urlencoding $enc -} -result {%3f} +} -result {%3F} # cleanup catch {unset url} diff --git a/unix/Makefile.in b/unix/Makefile.in index 154f1b9..0a22a58 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -829,8 +829,8 @@ install-libraries: libraries do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/http1.0; \ done; - @echo "Installing package http 2.8.3 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.6/http-2.8.3.tm; + @echo "Installing package http 2.8.4 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.6/http-2.8.4.tm; @echo "Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/"; @for i in $(TOP_DIR)/library/opt/*.tcl ; \ do \ @@ -990,6 +990,7 @@ COMPILEHDR=$(GENERIC_DIR)/tclCompile.h FSHDR=$(GENERIC_DIR)/tclFileSystem.h IOHDR=$(GENERIC_DIR)/tclIO.h MATHHDRS=$(GENERIC_DIR)/tommath.h $(GENERIC_DIR)/tclTomMath.h +PARSEHDR=$(GENERIC_DIR)/tclParse.h NREHDR=$(GENERIC_DIR)/tclInt.h regcomp.o: $(REGHDRS) $(GENERIC_DIR)/regcomp.c $(GENERIC_DIR)/regc_lex.c \ @@ -1186,7 +1187,7 @@ tclOOMethod.o: $(GENERIC_DIR)/tclOOMethod.c tclOOStubInit.o: $(GENERIC_DIR)/tclOOStubInit.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOStubInit.c -tclParse.o: $(GENERIC_DIR)/tclParse.c +tclParse.o: $(GENERIC_DIR)/tclParse.c $(PARSEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclParse.c tclPanic.o: $(GENERIC_DIR)/tclPanic.c @@ -1258,7 +1259,7 @@ tclStubInit.o: $(GENERIC_DIR)/tclStubInit.c tclTrace.o: $(GENERIC_DIR)/tclTrace.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclTrace.c -tclUtil.o: $(GENERIC_DIR)/tclUtil.c +tclUtil.o: $(GENERIC_DIR)/tclUtil.c $(PARSEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclUtil.c tclUtf.o: $(GENERIC_DIR)/tclUtf.c $(GENERIC_DIR)/tclUniData.c diff --git a/unix/configure b/unix/configure index 72d704d..72d5d73 100755 --- a/unix/configure +++ b/unix/configure @@ -7061,6 +7061,9 @@ fi DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a' + TCL_SHLIB_LD_EXTRAS='-Wl,--out-implib,$@.a' ;; dgux*) SHLIB_CFLAGS="-K PIC" diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 2f7cb16..39f8ca1 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1228,6 +1228,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a' + TCL_SHLIB_LD_EXTRAS='-Wl,--out-implib,$[@].a' ;; dgux*) SHLIB_CFLAGS="-K PIC" diff --git a/win/Makefile.in b/win/Makefile.in index 8880dc6..8492b8f 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -662,8 +662,8 @@ install-libraries: libraries install-tzdata install-msgs do \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/http1.0"; \ done; - @echo "Installing package http 2.8.3 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.6/http-2.8.3.tm; + @echo "Installing package http 2.8.4 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.6/http-2.8.4.tm; @echo "Installing library opt0.4 directory"; @for j in $(ROOT_DIR)/library/opt/*.tcl; \ do \ diff --git a/win/tclWinPort.h b/win/tclWinPort.h index d94bfda..e5dac8c 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -36,6 +36,12 @@ #include <windows.h> #undef WIN32_LEAN_AND_MEAN +/* Compatibility to older visual studio / windows platform SDK */ +#if !defined(MAXULONG_PTR) +typedef DWORD DWORD_PTR; +typedef DWORD_PTR * PDWORD_PTR; +#endif + /* * Ask for the winsock function typedefs, also. */ |