[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:31:07 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit fd5184237ad6680b234644b05b77fb192de6d562
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Mar 29 16:13:23 2004 +0000
Reviewed by John.
- fixed <rdar://problem/3602202>: "feed:uuid:...." links in Emerson content are being changed into "feed:uuuid:...."
* kwq/KWQKURL.mm: (copyPathRemovingDots): Add special case for empty path. The old code had an
assertion that explicitly allowed this case, but it copied a character from the src buffer,
which was incorrect.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 57b436b..0be6293 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,13 @@
+2004-03-28 Darin Adler <darin at apple.com>
+
+ Reviewed by John.
+
+ - fixed <rdar://problem/3602202>: "feed:uuid:...." links in Emerson content are being changed into "feed:uuuid:...."
+
+ * kwq/KWQKURL.mm: (copyPathRemovingDots): Add special case for empty path. The old code had an
+ assertion that explicitly allowed this case, but it copied a character from the src buffer,
+ which was incorrect.
+
2004-03-26 David Hyatt <hyatt at apple.com>
Fix for 3600642, letter magnet demo doesn't update until mouse move. This patch also fixes problems
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index 91424b1..e727471 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -925,53 +925,56 @@ static void appendEscapingBadChars(char*& buffer, const char *strStart, size_t l
// copy a path, accounting for "." and ".." segments
static int copyPathRemovingDots(char *dst, const char *src, int srcStart, int srcEnd)
{
- const char *baseStringStart = src + srcStart;
- const char *baseStringEnd = src + srcEnd;
char *bufferPathStart = dst;
- const char *baseStringPos = baseStringStart;
-
- // this code is unprepared for paths that do not begin with a
- // slash and we should always have one in the source string (but a
- // totally empty path is OK and does not need to start with a slash)
- ASSERT(srcStart == srcEnd || baseStringPos[0] == '/');
-
- // copy the leading slash into the destination
- *dst = *baseStringPos;
- baseStringPos++;
- dst++;
-
- while (baseStringPos < baseStringEnd) {
- if (baseStringPos[0] == '.' && dst[-1] == '/') {
- if (baseStringPos[1] == '/' || baseStringPos + 1 == baseStringEnd) {
- // skip over "." segment
- baseStringPos += 2;
- continue;
- } else if (baseStringPos[1] == '.' && (baseStringPos[2] == '/' ||
- baseStringPos + 2 == baseStringEnd)) {
- // skip over ".." segment and rewind the last segment
- // the RFC leaves it up to the app to decide what to do with excess
- // ".." segments - we choose to drop them since some web content
- // relies on this.
- baseStringPos += 3;
- if (dst > bufferPathStart + 1) {
- dst--;
- }
- // Note that these two while blocks differ subtly.
- // The first helps to remove multiple adjoining slashes as we rewind.
- // The +1 to bufferPathStart in the first while block prevents eating a leading slash
- while (dst > bufferPathStart + 1 && dst[-1] == '/') {
- dst--;
- }
- while (dst > bufferPathStart && dst[-1] != '/') {
- dst--;
- }
- continue;
- }
- }
+ // empty path is a special case, and need not have a leading slash
+ if (srcStart != srcEnd) {
+ const char *baseStringStart = src + srcStart;
+ const char *baseStringEnd = src + srcEnd;
+ const char *baseStringPos = baseStringStart;
+
+ // this code is unprepared for paths that do not begin with a
+ // slash and we should always have one in the source string
+ ASSERT(baseStringPos[0] == '/');
+
+ // copy the leading slash into the destination
*dst = *baseStringPos;
baseStringPos++;
dst++;
+
+ while (baseStringPos < baseStringEnd) {
+ if (baseStringPos[0] == '.' && dst[-1] == '/') {
+ if (baseStringPos[1] == '/' || baseStringPos + 1 == baseStringEnd) {
+ // skip over "." segment
+ baseStringPos += 2;
+ continue;
+ } else if (baseStringPos[1] == '.' && (baseStringPos[2] == '/' ||
+ baseStringPos + 2 == baseStringEnd)) {
+ // skip over ".." segment and rewind the last segment
+ // the RFC leaves it up to the app to decide what to do with excess
+ // ".." segments - we choose to drop them since some web content
+ // relies on this.
+ baseStringPos += 3;
+ if (dst > bufferPathStart + 1) {
+ dst--;
+ }
+ // Note that these two while blocks differ subtly.
+ // The first helps to remove multiple adjoining slashes as we rewind.
+ // The +1 to bufferPathStart in the first while block prevents eating a leading slash
+ while (dst > bufferPathStart + 1 && dst[-1] == '/') {
+ dst--;
+ }
+ while (dst > bufferPathStart && dst[-1] != '/') {
+ dst--;
+ }
+ continue;
+ }
+ }
+
+ *dst = *baseStringPos;
+ baseStringPos++;
+ dst++;
+ }
}
*dst = '\0';
return dst - bufferPathStart;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list