typop: with many args, pop first then queue the others

This commit is contained in:
Boris Faure 2019-10-10 23:37:51 +02:00
parent 80124a72ca
commit 4b24157e2b
1 changed files with 2 additions and 1 deletions

View File

@ -37,7 +37,8 @@ main(int argc, char **argv)
path = argv[i];
if (realpath(path, buf)) path = buf;
snprintf(tbuf, sizeof(tbuf), "%c}pn%s", 0x1b, path);
snprintf(tbuf, sizeof(tbuf), "%c}p%c%s", 0x1b,
(i == 1) ? 'n': 'q', path);
if (write(1, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1)) perror("write");
}
return 0;