From ad8d48f9036f92de1cb2ab1109236809d2243796 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 13 Jun 2018 16:23:21 +0000 Subject: [FileSpec] Delegate common operations to llvm::sys::path With the recent changes in FileSpec to use LLVM's path style, it is possible to delegate a bunch of common path operations to LLVM's path helpers. This means we only have to maintain a single implementation and at the same time can benefit from the efforts made by the rest of the LLVM community. This is part one of a set of patches. There was no obvious way to split this so I just worked from top to bottom. Differential revision: https://reviews.llvm.org/D48084 llvm-svn: 334615 --- .../Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 5bb6e17..8c7517f 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -2590,9 +2590,9 @@ bool ScriptInterpreterPython::LoadScriptingModule( // strip .py or .pyc extension ConstString extension = target_file.GetFileNameExtension(); if (extension) { - if (::strcmp(extension.GetCString(), "py") == 0) + if (llvm::StringRef(extension.GetCString()) == ".py") basename.resize(basename.length() - 3); - else if (::strcmp(extension.GetCString(), "pyc") == 0) + else if (llvm::StringRef(extension.GetCString()) == ".pyc") basename.resize(basename.length() - 4); } } else { -- cgit v1.1