diff options
author | Darren Tucker <dtucker@zip.com.au> | 2010-01-13 22:45:03 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2010-01-13 22:45:03 +1100 |
commit | 9c3ba07f60434e68657630fec0d7ab0dd7f984a3 (patch) | |
tree | 519767dbb514d345fde041aa9fae5023c8f57a67 /sftp.c | |
parent | 88b6fb2b55a5c8bb9aeadec185991c5bfae780c0 (diff) |
- djm@cvs.openbsd.org 2010/01/13 04:10:50
[sftp.c]
don't append a space after inserting a completion of a directory (i.e.
a path ending in '/') for a slightly better user experience; ok dtucker@
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sftp.c,v 1.119 2010/01/13 01:40:16 djm Exp $ */ | 1 | /* $OpenBSD: sftp.c,v 1.120 2010/01/13 04:10:50 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -1760,15 +1760,12 @@ complete_match(EditLine *el, struct sftp_conn *conn, char *remote_path, | |||
1760 | } | 1760 | } |
1761 | 1761 | ||
1762 | lf = el_line(el); | 1762 | lf = el_line(el); |
1763 | /* | ||
1764 | * XXX should we really extend here? the user may not be done if | ||
1765 | * the filename is a directory. | ||
1766 | */ | ||
1767 | if (g.gl_matchc == 1) { | 1763 | if (g.gl_matchc == 1) { |
1768 | i = 0; | 1764 | i = 0; |
1769 | if (!terminated) | 1765 | if (!terminated) |
1770 | ins[i++] = quote; | 1766 | ins[i++] = quote; |
1771 | if (lastarg || *(lf->cursor) != ' ') | 1767 | if (*(lf->cursor - 1) != '/' && |
1768 | (lastarg || *(lf->cursor) != ' ')) | ||
1772 | ins[i++] = ' '; | 1769 | ins[i++] = ' '; |
1773 | ins[i] = '\0'; | 1770 | ins[i] = '\0'; |
1774 | if (i > 0 && el_insertstr(el, ins) == -1) | 1771 | if (i > 0 && el_insertstr(el, ins) == -1) |