diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 01:19:43 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 01:19:43 +0000 |
commit | 96690a420b73c1b5a4ae350a1a13963b90dabbec (patch) | |
tree | 7870d1347381cb41be4be98fa3a29ddd67629859 /chrome/browser/gtk/options/advanced_contents_gtk.cc | |
parent | 6ee15630603b46b24c02dcf4d4cf8b8412af52aa (diff) | |
download | chromium_src-96690a420b73c1b5a4ae350a1a13963b90dabbec.zip chromium_src-96690a420b73c1b5a4ae350a1a13963b90dabbec.tar.gz chromium_src-96690a420b73c1b5a4ae350a1a13963b90dabbec.tar.bz2 |
Fix cases that initialized StringTokenizer with a temporary.
Fix examples in StringTokenizer header that recommended doing that.
BUG=none
TEST=on linux, open options, click proxy configuration button a bunch. It should not fail intermittently.
Review URL: http://codereview.chromium.org/174490
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24398 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/options/advanced_contents_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/options/advanced_contents_gtk.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc index c50e77c..891fd71 100644 --- a/chrome/browser/gtk/options/advanced_contents_gtk.cc +++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc @@ -411,8 +411,10 @@ void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button, bool NetworkSection::SearchPATH(ProxyConfigCommand* commands, size_t ncommands, size_t* index) { const char* path = getenv("PATH"); + if (!path) + return false; FilePath bin_path; - StringTokenizer tk(path, ":"); + CStringTokenizer tk(path, path + strlen(path), ":"); // Search $PATH looking for the commands in order. while (tk.GetNext()) { for (size_t i = 0; i < ncommands; i++) { |