Fix execute not to mangle the argument when it prompts for it

The argument is UTF-8.  If it's missing, execute() gets it with
getstring(), which mangles non-ASCII characters.  Clients reject
mangled file names for security reasons.

Fix by switching to ugetstring().  Missed in commit 69832255, v4.3.11.

Non-ASCII characters are still mangled in ASCII sessions, but that's
not expected to work.
This commit is contained in:
Markus Armbruster 2011-07-02 10:04:07 +02:00
parent 0493cbc655
commit 0bfdbfcbdd

View file

@ -242,18 +242,17 @@ make_stale_if_command_arg(char *arg)
int
execute(void)
{
char buf[1024];
char buf[1024]; /* UTF-8 */
int failed;
char *p;
char *p; /* UTF-8 */
char *redir; /* UTF-8 */
char scanspace[1024];
failed = 0;
if (player->comtail[1])
p = player->comtail[1];
else
p = getstring("File? ", buf);
p = player->comtail[1];
if (!p)
p = ugetstring("File? ", buf);
if (p == NULL || *p == '\0')
return RET_SYN;
prexec(p);