Skip to content

Commit 1ff5216

Browse files
author
Jessie Berlin
committed
Hang underneath ApplicationCacheStorage::writeDataToUniqueFileInDirectory when loading
http://www.webkit.org/demos/calendar. https://bugs.webkit.org/show_bug.cgi?id=58698 Reviewed by Brian Weinstein. * platform/win/FileSystemWin.cpp: (WebCore::openFile): Add breaks to the case statement. (WebCore::directoryName): Remove any trailing slash in directoryName. After closer inspection of all callers, it appears the that callers do not need the trailing slash, and those that use the length do so only to change the direction of the slashes throughout the length of the path. Canonical link: https://commits.webkit.org/73792@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84051 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 3ee4a37 commit 1ff5216

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

Source/WebCore/ChangeLog

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2011-04-15 Jessie Berlin <jberlin@apple.com>
2+
3+
Reviewed by Brian Weinstein.
4+
5+
Hang underneath ApplicationCacheStorage::writeDataToUniqueFileInDirectory when loading
6+
http://www.webkit.org/demos/calendar.
7+
https://bugs.webkit.org/show_bug.cgi?id=58698
8+
9+
* platform/win/FileSystemWin.cpp:
10+
(WebCore::openFile):
11+
Add breaks to the case statement.
12+
(WebCore::directoryName):
13+
Remove any trailing slash in directoryName. After closer inspection of all callers, it
14+
appears the that callers do not need the trailing slash, and those that use the length do
15+
so only to change the direction of the slashes throughout the length of the path.
16+
117
2011-04-15 Roland Steiner <rolandsteiner@chromium.org>
218

319
Reviewed by Dimitri Glazkov.

Source/WebCore/platform/win/FileSystemWin.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ String pathGetFileName(const String& path)
136136

137137
String directoryName(const String& path)
138138
{
139-
return path.left(path.length() - pathGetFileName(path).length());
139+
String name = path.left(path.length() - pathGetFileName(path).length());
140+
if (name.characterStartingAt(name.length() - 1) == '\\') {
141+
// Remove any trailing "\".
142+
name.truncate(name.length() - 1);
143+
}
144+
return name;
140145
}
141146

142147
static String bundleName()
@@ -241,9 +246,11 @@ PlatformFileHandle openFile(const String& path, FileOpenMode mode)
241246
case OpenForRead:
242247
desiredAccess = GENERIC_READ;
243248
creationDisposition = OPEN_EXISTING;
249+
break;
244250
case OpenForWrite:
245251
desiredAccess = GENERIC_WRITE;
246252
creationDisposition = CREATE_ALWAYS;
253+
break;
247254
default:
248255
ASSERT_NOT_REACHED();
249256
}

0 commit comments

Comments
 (0)