From ec25c31a92a6d44e88be69c21e84de53089b2d90 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 4 Feb 2020 20:37:26 -0800 Subject: [PATCH] Update s3_file_system.cc --- tensorflow/core/platform/s3/s3_file_system.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/core/platform/s3/s3_file_system.cc b/tensorflow/core/platform/s3/s3_file_system.cc index 35d2faa608e..bb256f0cf0a 100644 --- a/tensorflow/core/platform/s3/s3_file_system.cc +++ b/tensorflow/core/platform/s3/s3_file_system.cc @@ -400,7 +400,7 @@ Status S3FileSystem::GetChildren(const string& dir, string bucket, prefix; TF_RETURN_IF_ERROR(ParseS3Path(dir, true, &bucket, &prefix)); - if (prefix.empty() || prefix.back() != '/') { + if (!prefix.empty() && prefix.back() != '/') { prefix.push_back('/'); }