mirror of
https://github.com/jarun/nnn.git
synced 2025-03-12 17:54:04 +00:00
Revert searching for a leading space
%j and %J will be replaced by a file path. File paths should be quoted to ensure proper interpretation by the shell
This commit is contained in:
parent
73ef170da7
commit
1022340aa1
1 changed files with 2 additions and 4 deletions
|
@ -5379,9 +5379,8 @@ static bool prompt_run(void)
|
|||
|
||||
cnt_j = 0;
|
||||
next = cmdline;
|
||||
while ((next = strstr(next, " %j"))) {
|
||||
while ((next = strstr(next, "%j"))) {
|
||||
++cnt_j;
|
||||
++next; // skip the space we don't need it
|
||||
|
||||
// replace %j with {} for xargs later
|
||||
next[0] = '{';
|
||||
|
@ -5392,9 +5391,8 @@ static bool prompt_run(void)
|
|||
|
||||
cnt_J = 0;
|
||||
next = cmdline;
|
||||
while (!cnt_j && (next = strstr(next, " %J"))) {
|
||||
while (!cnt_j && (next = strstr(next, "%J"))) {
|
||||
++cnt_J;
|
||||
++next; // skip the space we don't need it
|
||||
|
||||
tmplen = xstrsncpy(tmpcmd, cmdline, next - cmdline + 1) - 1;
|
||||
tmplen += xstrsncpy(tmpcmd + tmplen, "${0} ${@}", sizeof("${0} ${@}"));
|
||||
|
|
Loading…
Add table
Reference in a new issue