import of readlilne 5.1
[deliverable/binutils-gdb.git] / readline / kill.c
index a616b920d903b592411bb3e4e61bfbef5919df7b..1d3254c3275dc62260c1f481355ea70299f9724c 100644 (file)
@@ -339,6 +339,47 @@ rl_unix_word_rubout (count, key)
       if (rl_editing_mode == emacs_mode)
        rl_mark = rl_point;
     }
+
+  return 0;
+}
+
+/* This deletes one filename component in a Unix pathname.  That is, it
+   deletes backward to directory separator (`/') or whitespace.  */
+int
+rl_unix_filename_rubout (count, key)
+     int count, key;
+{
+  int orig_point, c;
+
+  if (rl_point == 0)
+    rl_ding ();
+  else
+    {
+      orig_point = rl_point;
+      if (count <= 0)
+       count = 1;
+
+      while (count--)
+       {
+         c = rl_line_buffer[rl_point - 1];
+         while (rl_point && (whitespace (c) || c == '/'))
+           {
+             rl_point--;
+             c = rl_line_buffer[rl_point - 1];
+           }
+
+         while (rl_point && (whitespace (c) == 0) && c != '/')
+           {
+             rl_point--;
+             c = rl_line_buffer[rl_point - 1];
+           }
+       }
+
+      rl_kill_text (orig_point, rl_point);
+      if (rl_editing_mode == emacs_mode)
+       rl_mark = rl_point;
+    }
+
   return 0;
 }
 
This page took 0.02828 seconds and 4 git commands to generate.