From cb5eecc22ab9efacf2eeb0a9369fe465d831d17e Mon Sep 17 00:00:00 2001 From: "andreas.otte%primus-online.de" Date: Sun, 27 Feb 2000 09:53:15 +0000 Subject: [PATCH] completing changes for bug 22251. You also have to unzip the zip file attached to bug 22251 in mozilla/rdf to get the missing protocolhandlers. git-svn-id: svn://10.0.0.236/branches/BUG22251_BRANCH@61761 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/allmakefiles.sh | 7 +++++++ mozilla/netwerk/base/src/nsURLHelper.cpp | 24 +++++++++++++++--------- mozilla/rdf/Makefile.in | 2 +- mozilla/rdf/makefile.win | 1 + 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/mozilla/allmakefiles.sh b/mozilla/allmakefiles.sh index 15292163a08..3948ac6f555 100755 --- a/mozilla/allmakefiles.sh +++ b/mozilla/allmakefiles.sh @@ -419,6 +419,13 @@ rdf/tests/localfile/Makefile rdf/tests/rdfsink/Makefile rdf/tests/rdfcat/Makefile rdf/tests/rdfpoll/Makefile +rdf/protocol/Makefile +rdf/protocol/rdf/Makefile +rdf/protocol/rdf/src/Makefile +rdf/protocol/urn/Makefile +rdf/protocol/urn/src/Makefile +rdf/protocol/nc/Makefile +rdf/protocol/nc/src/Makefile sun-java/Makefile sun-java/stubs/Makefile sun-java/stubs/include/Makefile diff --git a/mozilla/netwerk/base/src/nsURLHelper.cpp b/mozilla/netwerk/base/src/nsURLHelper.cpp index f67fa5c5640..655cd6490d2 100644 --- a/mozilla/netwerk/base/src/nsURLHelper.cpp +++ b/mozilla/netwerk/base/src/nsURLHelper.cpp @@ -30,7 +30,7 @@ const int EscapeChars[256] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1x */ 0,1023, 0, 512, 761, 0,1023, 0,1023,1023,1023,1023,1023,1023, 959, 912, /* 2x !"#$%&'()*+,-./ */ - 1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1008, 896, 0,1008, 0, 768, /* 3x 0123456789:;<=>? */ + 1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, 912, 896, 0,1008, 0, 768, /* 3x 0123456789:;<=>? */ 992,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, /* 4x @ABCDEFGHIJKLMNO */ 1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, 896, 896, 896, 896,1023, /* 5x PQRSTUVWXYZ[\]^_ */ 0,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, /* 6x `abcdefghijklmno */ @@ -75,7 +75,7 @@ nsURLEscape(const char* str, PRInt16 mask, nsCString &result) src = (const unsigned char *) str; char tempBuffer[100]; - int tempBufferPos = 0; + unsigned int tempBufferPos = 0; char c1[] = " "; char c2[] = " "; @@ -86,7 +86,10 @@ nsURLEscape(const char* str, PRInt16 mask, nsCString &result) { c1[0] = *(src+1); - c2[0] = *(src+2); + if (*(src+1) == '\0') + c2[0] = '\0'; + else + c2[0] = *(src+2); unsigned char c = *src++; /* if the char has not to be escaped or whatever follows % is @@ -103,12 +106,12 @@ nsURLEscape(const char* str, PRInt16 mask, nsCString &result) tempBuffer[tempBufferPos++] = hexChars[c >> 4]; /* high nibble */ tempBuffer[tempBufferPos++] = hexChars[c & 0x0f]; /* low nibble */ } - if(tempBufferPos == 96) - { - tempBuffer[tempBufferPos] = '\0'; + if(tempBufferPos >= sizeof(tempBuffer) - 4) + { + tempBuffer[tempBufferPos] = '\0'; result += tempBuffer; - tempBufferPos = 0; - } + tempBufferPos = 0; + } } tempBuffer[tempBufferPos] = '\0'; result += tempBuffer; @@ -148,7 +151,10 @@ nsURLUnescape(char* str, char **result) while (*src) { c1[0] = *(src+1); - c2[0] = *(src+2); + if (*(src+1) == '\0') + c2[0] = '\0'; + else + c2[0] = *(src+2); /* check for valid escaped sequence */ if (*src != HEX_ESCAPE || PL_strpbrk(pc1, hexChars) == 0 || diff --git a/mozilla/rdf/Makefile.in b/mozilla/rdf/Makefile.in index 5eb25067bca..1324a9a5fa5 100644 --- a/mozilla/rdf/Makefile.in +++ b/mozilla/rdf/Makefile.in @@ -26,7 +26,7 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = base util content datasource resources chrome build +DIRS = base util content datasource resources chrome build protocol ifdef ENABLE_TESTS DIRS += tests diff --git a/mozilla/rdf/makefile.win b/mozilla/rdf/makefile.win index 2fbd854c566..8a89fb3c820 100644 --- a/mozilla/rdf/makefile.win +++ b/mozilla/rdf/makefile.win @@ -31,6 +31,7 @@ DIRS=\ resources \ build \ chrome \ + protocol \ !if !defined(DISABLE_TESTS) tests \ !endif