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"), " '\"<>()&;"}};
 


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"), " '\"<>()&;"}};
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] ... Jonas Devlieghere via Phabricator via lldb-commits

Reply via email to