[Lldb-commits] [PATCH] D123690: [lldb] Expand $ when using tcsh

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 13 10:09:43 PDT 2022


JDevlieghere created this revision.
JDevlieghere added a reviewer: jingham.
Herald added a project: All.
JDevlieghere requested review of this revision.

Unlike for any of the other shells, we were escaping $ when using tcsh.
There's nothing special about $ in tcsh and this prevents you from
expanding shell variables, one of the main reasons this functionality
exists in the first place.


https://reviews.llvm.org/D123690

Files:
  lldb/source/Utility/Args.cpp
  lldb/unittests/Utility/ArgsTest.cpp


Index: lldb/unittests/Utility/ArgsTest.cpp
===================================================================
--- lldb/unittests/Utility/ArgsTest.cpp
+++ lldb/unittests/Utility/ArgsTest.cpp
@@ -336,8 +336,8 @@
 
   // Test escaping tcsh special characters.
   FileSpec tcsh("/bin/tcsh", FileSpec::Style::posix);
-  EXPECT_EQ(Args::GetShellSafeArgument(tcsh, R"( '"<>()&$;)"),
-            R"(\ \'\"\<\>\(\)\&\$\;)");
+  EXPECT_EQ(Args::GetShellSafeArgument(tcsh, R"( '"<>()&;)"),
+            R"(\ \'\"\<\>\(\)\&\;)");
   // Normal characters and globbing expressions that shouldn't be escaped.
   EXPECT_EQ(Args::GetShellSafeArgument(tcsh, "aA1*"), "aA1*");
 
Index: lldb/source/Utility/Args.cpp
===================================================================
--- lldb/source/Utility/Args.cpp
+++ lldb/source/Utility/Args.cpp
@@ -385,7 +385,7 @@
   };
 
   static ShellDescriptor g_Shells[] = {{ConstString("bash"), " '\"<>()&;"},
-                                       {ConstString("tcsh"), " '\"<>()&$;"},
+                                       {ConstString("tcsh"), " '\"<>()&;"},
                                        {ConstString("zsh"), " '\"<>()&;\\|"},
                                        {ConstString("sh"), " '\"<>()&;"}};
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123690.422551.patch
Type: text/x-patch
Size: 1249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220413/4cce7aa5/attachment.bin>


More information about the lldb-commits mailing list