Skip to content

Commit d82ad89

Browse files
committed
unix-filename-rubout uses forward slashes too
1 parent 52a9299 commit d82ad89

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

readline/readline.patch

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,31 @@ index 3ed21cc..03bcbde 100644
325325
matches = *matchesp;
326326

327327
if (matches == 0)
328+
diff --git a/readline/readline/kill.c b/readline/readline/kill.c
329+
index 1a78783f..ad7df09e 100644
330+
--- a/readline/readline/kill.c
331+
+++ b/readline/readline/kill.c
332+
@@ -362,13 +362,21 @@ rl_unix_filename_rubout (count, key)
333+
while (count--)
334+
{
335+
c = rl_line_buffer[rl_point - 1];
336+
- while (rl_point && (whitespace (c) || c == '/'))
337+
+/* begin_clink_change
338+
+ * Treat forward-slashes as path separators too
339+
+ */
340+
+ while (rl_point && (whitespace (c) || c == '/' || c == '\\'))
341+
+/* end_clink_change */
342+
{
343+
rl_point--;
344+
c = rl_line_buffer[rl_point - 1];
345+
}
346+
347+
- while (rl_point && (whitespace (c) == 0) && c != '/')
348+
+/* begin_clink_change
349+
+ * Treat forward-slashes as path separators too
350+
+ */
351+
+ while (rl_point && (whitespace (c) == 0) && c != '/' && c != '\\')
352+
+/* end_clink_change */
353+
{
354+
rl_point--;
355+
c = rl_line_buffer[rl_point - 1];

readline/readline/kill.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,21 @@ rl_unix_filename_rubout (count, key)
362362
while (count--)
363363
{
364364
c = rl_line_buffer[rl_point - 1];
365-
while (rl_point && (whitespace (c) || c == '/'))
365+
/* begin_clink_change
366+
* Treat forward-slashes as path separators too
367+
*/
368+
while (rl_point && (whitespace (c) || c == '/' || c == '\\'))
369+
/* end_clink_change */
366370
{
367371
rl_point--;
368372
c = rl_line_buffer[rl_point - 1];
369373
}
370374

371-
while (rl_point && (whitespace (c) == 0) && c != '/')
375+
/* begin_clink_change
376+
* Treat forward-slashes as path separators too
377+
*/
378+
while (rl_point && (whitespace (c) == 0) && c != '/' && c != '\\')
379+
/* end_clink_change */
372380
{
373381
rl_point--;
374382
c = rl_line_buffer[rl_point - 1];

0 commit comments

Comments
 (0)