diff options
author | 2016-09-13 13:53:30 -0800 | |
---|---|---|
committer | 2016-09-13 15:02:03 -0700 | |
commit | b694ceff1438dccd9751950f1a02a0d49936cd19 (patch) | |
tree | 803e7ded58518f37ef7a918e5adddd6d38b79b25 /tensorflow/core/platform/env.cc | |
parent | 805b23516bdf5b4009d584d7809606debd137c24 (diff) |
Fixes the issue when RecursivelyCreateDir hangs when the input is the empty string.
Change: 133051324
Diffstat (limited to 'tensorflow/core/platform/env.cc')
-rw-r--r-- | tensorflow/core/platform/env.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/core/platform/env.cc b/tensorflow/core/platform/env.cc index 9cb2c36839..16cdd561a3 100644 --- a/tensorflow/core/platform/env.cc +++ b/tensorflow/core/platform/env.cc @@ -142,7 +142,7 @@ Status Env::RecursivelyCreateDir(const string& dirname) { TF_RETURN_IF_ERROR(GetFileSystemForFile(dirname, &fs)); std::vector<StringPiece> sub_dirs; StringPiece remaining_dir(dirname); - while (!fs->FileExists(remaining_dir.ToString())) { + while (!fs->FileExists(remaining_dir.ToString()) && !remaining_dir.empty()) { // Basename returns "" for / ending dirs. if (!remaining_dir.ends_with("/")) { sub_dirs.push_back(io::Basename(remaining_dir)); |