|
Lines 31-36
Link Here
|
| 31 |
|
31 |
|
| 32 |
#include <ctype.h> |
32 |
#include <ctype.h> |
| 33 |
#include <errno.h> |
33 |
#include <errno.h> |
|
|
34 |
#include <locale.h> |
| 34 |
|
35 |
|
| 35 |
#ifdef HAVE_PATHS_H |
36 |
#ifdef HAVE_PATHS_H |
| 36 |
# include <paths.h> |
37 |
# include <paths.h> |
|
Lines 1694-1701
complete_match(EditLine *el, struct sftp
Link Here
|
| 1694 |
char *file, int remote, int lastarg, char quote, int terminated) |
1695 |
char *file, int remote, int lastarg, char quote, int terminated) |
| 1695 |
{ |
1696 |
{ |
| 1696 |
glob_t g; |
1697 |
glob_t g; |
| 1697 |
char *tmp, *tmp2, ins[3]; |
1698 |
char *tmp, *tmp2, ins[8]; |
| 1698 |
u_int i, hadglob, pwdlen, len, tmplen, filelen, cesc, isesc, isabs; |
1699 |
u_int i, hadglob, pwdlen, len, tmplen, filelen, cesc, isesc, isabs; |
|
|
1700 |
int clen; |
| 1699 |
const LineInfo *lf; |
1701 |
const LineInfo *lf; |
| 1700 |
|
1702 |
|
| 1701 |
/* Glob from "file" location */ |
1703 |
/* Glob from "file" location */ |
|
Lines 1764-1773
complete_match(EditLine *el, struct sftp
Link Here
|
| 1764 |
tmp2 = tmp + filelen - cesc; |
1766 |
tmp2 = tmp + filelen - cesc; |
| 1765 |
len = strlen(tmp2); |
1767 |
len = strlen(tmp2); |
| 1766 |
/* quote argument on way out */ |
1768 |
/* quote argument on way out */ |
| 1767 |
for (i = 0; i < len; i++) { |
1769 |
for (i = 0; i < len; i += clen) { |
|
|
1770 |
if ((clen = mblen(tmp2 + i, len - i)) == -1 || |
| 1771 |
clen > sizeof(ins) - 2) |
| 1772 |
fatal("invalid multibyte character"); |
| 1768 |
ins[0] = '\\'; |
1773 |
ins[0] = '\\'; |
| 1769 |
ins[1] = tmp2[i]; |
1774 |
memcpy(ins + 1, tmp2 + i, clen); |
| 1770 |
ins[2] = '\0'; |
1775 |
ins[clen + 1] = '\0'; |
| 1771 |
switch (tmp2[i]) { |
1776 |
switch (tmp2[i]) { |
| 1772 |
case '\'': |
1777 |
case '\'': |
| 1773 |
case '"': |
1778 |
case '"': |
|
Lines 2112-2117
main(int argc, char **argv)
Link Here
|
| 2112 |
|
2117 |
|
| 2113 |
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ |
2118 |
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ |
| 2114 |
sanitise_stdfd(); |
2119 |
sanitise_stdfd(); |
|
|
2120 |
setlocale(LC_CTYPE, ""); |
| 2115 |
|
2121 |
|
| 2116 |
__progname = ssh_get_progname(argv[0]); |
2122 |
__progname = ssh_get_progname(argv[0]); |
| 2117 |
memset(&args, '\0', sizeof(args)); |
2123 |
memset(&args, '\0', sizeof(args)); |