Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5100)

Unified Diff: chrome/browser/gtk/options/advanced_contents_gtk.cc

Issue 174490: Fix cases that initialized StringTokenizer with a temporary. (Closed)
Patch Set: check for null path Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/string_tokenizer.h ('k') | chrome/browser/shell_integration_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/options/advanced_contents_gtk.cc
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc
index c50e77cf2ed7f3007628d486596ec3d8b2260b65..891fd71f579605be06c5932f0729046e18526800 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++) {
« no previous file with comments | « base/string_tokenizer.h ('k') | chrome/browser/shell_integration_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698