summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/data/ftp/dir-listing-ls-1-utf86
-rw-r--r--net/data/ftp/dir-listing-ls-1-utf8.expected53
-rw-r--r--net/ftp/ftp_directory_listing_buffer.cc1
-rw-r--r--net/ftp/ftp_directory_listing_buffer_unittest.cc1
-rw-r--r--webkit/glue/ftp_directory_listing_response_delegate.cc1
5 files changed, 62 insertions, 0 deletions
diff --git a/net/data/ftp/dir-listing-ls-1-utf8 b/net/data/ftp/dir-listing-ls-1-utf8
new file mode 100644
index 0000000..8f33030
--- /dev/null
+++ b/net/data/ftp/dir-listing-ls-1-utf8
@@ -0,0 +1,6 @@
+drwxr-xr-x 3 ftp ftp 4096 May 15 18:11 .
+drwxr-xr-x 3 ftp ftp 4096 May 15 18:11 ..
+-rw-r--r-- 1 ftp ftp 528 Nov 01 2007 .message
+-rw-r--r-- 1 ftp ftp 528 Nov 01 2007 README!
+-rw-r--r-- 1 ftp ftp 560 Sep 28 2007 こんにちは.html
+drwxr-xr-x 33 ftp ftp 4096 Aug 12 2008 pub
diff --git a/net/data/ftp/dir-listing-ls-1-utf8.expected b/net/data/ftp/dir-listing-ls-1-utf8.expected
new file mode 100644
index 0000000..bdb02ba
--- /dev/null
+++ b/net/data/ftp/dir-listing-ls-1-utf8.expected
@@ -0,0 +1,53 @@
+d
+.
+-1
+current
+5
+15
+18
+11
+
+d
+..
+-1
+current
+5
+15
+18
+11
+
+-
+.message
+528
+2007
+11
+1
+0
+0
+
+-
+README!
+528
+2007
+11
+1
+0
+0
+
+-
+こんにちは.html
+560
+2007
+9
+28
+0
+0
+
+d
+pub
+-1
+2008
+8
+12
+0
+0
diff --git a/net/ftp/ftp_directory_listing_buffer.cc b/net/ftp/ftp_directory_listing_buffer.cc
index 030da83..d7833e8 100644
--- a/net/ftp/ftp_directory_listing_buffer.cc
+++ b/net/ftp/ftp_directory_listing_buffer.cc
@@ -27,6 +27,7 @@ std::string DetectEncoding(const std::string& text) {
&status);
const UCharsetMatch* match = ucsdet_detect(detector, &status);
const char* encoding = ucsdet_getName(match, &status);
+ ucsdet_close(detector);
// Should we check the quality of the match? A rather arbitrary number is
// assigned by ICU and it's hard to come up with a lower limit.
if (U_FAILURE(status))
diff --git a/net/ftp/ftp_directory_listing_buffer_unittest.cc b/net/ftp/ftp_directory_listing_buffer_unittest.cc
index f8f1a51..ae448fb 100644
--- a/net/ftp/ftp_directory_listing_buffer_unittest.cc
+++ b/net/ftp/ftp_directory_listing_buffer_unittest.cc
@@ -17,6 +17,7 @@ namespace {
TEST(FtpDirectoryListingBufferTest, Parse) {
const char* test_files[] = {
"dir-listing-ls-1",
+ "dir-listing-ls-1-utf8",
"dir-listing-ls-2",
"dir-listing-vms-1",
"dir-listing-vms-2",
diff --git a/webkit/glue/ftp_directory_listing_response_delegate.cc b/webkit/glue/ftp_directory_listing_response_delegate.cc
index 64f529c..093973e 100644
--- a/webkit/glue/ftp_directory_listing_response_delegate.cc
+++ b/webkit/glue/ftp_directory_listing_response_delegate.cc
@@ -38,6 +38,7 @@ std::string DetectEncoding(const std::string& text) {
&status);
const UCharsetMatch* match = ucsdet_detect(detector, &status);
const char* encoding = ucsdet_getName(match, &status);
+ ucsdet_close(detector);
// Should we check the quality of the match? A rather arbitrary number is
// assigned by ICU and it's hard to come up with a lower limit.
if (U_FAILURE(status))