From c5273d929f54f9499d1cdea6e3112d6cdf9b18b1 Mon Sep 17 00:00:00 2001 From: Stephane Sezer Date: Thu, 24 Mar 2016 22:22:20 +0000 Subject: Make File option flags consistent for Python API Summary: Fixes SBCommandReturnObject::SetImmediateOutputFile() and SBCommandReturnObject::SetImmediateOutputFile() for files opened with "a" or "a+" by resolving inconsistencies between File and our Python parsing of file objects. Reviewers: granata.enrico, Eugene.Zelenko, jingham, clayborg Subscribers: lldb-commits, sas Differential Revision: http://reviews.llvm.org/D18228 Change by Francis Ricci llvm-svn: 264351 --- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index 10dce60cbbb..02228df5147 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -1253,10 +1253,10 @@ PythonFile::GetOptionsFromMode(llvm::StringRef mode) return llvm::StringSwitch(mode.str().c_str()) .Case("r", File::eOpenOptionRead) .Case("w", File::eOpenOptionWrite) - .Case("a", File::eOpenOptionAppend|File::eOpenOptionCanCreate) + .Case("a", File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate) .Case("r+", File::eOpenOptionRead|File::eOpenOptionWrite) .Case("w+", File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate) - .Case("a+", File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate) + .Case("a+", File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate) .Default(0); } -- cgit v1.2.3