Skip to content

Commit

Permalink
unix-filename-rubout uses forward slashes too
Browse files Browse the repository at this point in the history
  • Loading branch information
mridgers committed May 18, 2023
1 parent 52a9299 commit d82ad89
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
28 changes: 28 additions & 0 deletions readline/readline.patch
Expand Up @@ -325,3 +325,31 @@ index 3ed21cc..03bcbde 100644
matches = *matchesp;

if (matches == 0)
diff --git a/readline/readline/kill.c b/readline/readline/kill.c
index 1a78783f..ad7df09e 100644
--- a/readline/readline/kill.c
+++ b/readline/readline/kill.c
@@ -362,13 +362,21 @@ rl_unix_filename_rubout (count, key)
while (count--)
{
c = rl_line_buffer[rl_point - 1];
- while (rl_point && (whitespace (c) || c == '/'))
+/* begin_clink_change
+ * Treat forward-slashes as path separators too
+ */
+ while (rl_point && (whitespace (c) || c == '/' || c == '\\'))
+/* end_clink_change */
{
rl_point--;
c = rl_line_buffer[rl_point - 1];
}

- while (rl_point && (whitespace (c) == 0) && c != '/')
+/* begin_clink_change
+ * Treat forward-slashes as path separators too
+ */
+ while (rl_point && (whitespace (c) == 0) && c != '/' && c != '\\')
+/* end_clink_change */
{
rl_point--;
c = rl_line_buffer[rl_point - 1];
12 changes: 10 additions & 2 deletions readline/readline/kill.c
Expand Up @@ -362,13 +362,21 @@ rl_unix_filename_rubout (count, key)
while (count--)
{
c = rl_line_buffer[rl_point - 1];
while (rl_point && (whitespace (c) || c == '/'))
/* begin_clink_change
* Treat forward-slashes as path separators too
*/
while (rl_point && (whitespace (c) || c == '/' || c == '\\'))
/* end_clink_change */
{
rl_point--;
c = rl_line_buffer[rl_point - 1];
}

while (rl_point && (whitespace (c) == 0) && c != '/')
/* begin_clink_change
* Treat forward-slashes as path separators too
*/
while (rl_point && (whitespace (c) == 0) && c != '/' && c != '\\')
/* end_clink_change */
{
rl_point--;
c = rl_line_buffer[rl_point - 1];
Expand Down

0 comments on commit d82ad89

Please sign in to comment.