summaryrefslogtreecommitdiffstats
path: root/webkit/database/database_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/database/database_util.cc')
-rw-r--r--webkit/database/database_util.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/webkit/database/database_util.cc b/webkit/database/database_util.cc
index ae52a5a..4866b30 100644
--- a/webkit/database/database_util.cc
+++ b/webkit/database/database_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,11 +28,16 @@ bool DatabaseUtil::CrackVfsFileName(const string16& vfs_file_name,
return false;
}
- *origin_identifier = vfs_file_name.substr(0, first_slash_index);
- *database_name = vfs_file_name.substr(
- first_slash_index + 1, last_pound_index - first_slash_index - 1);
- *sqlite_suffix = vfs_file_name.substr(
- last_pound_index + 1, vfs_file_name.length() - last_pound_index - 1);
+ if (origin_identifier)
+ *origin_identifier = vfs_file_name.substr(0, first_slash_index);
+ if (database_name) {
+ *database_name = vfs_file_name.substr(
+ first_slash_index + 1, last_pound_index - first_slash_index - 1);
+ }
+ if (sqlite_suffix) {
+ *sqlite_suffix = vfs_file_name.substr(
+ last_pound_index + 1, vfs_file_name.length() - last_pound_index - 1);
+ }
return true;
}