mirror of
https://codeberg.org/TicklishHoneyBee/CLIte.git
synced 2026-03-11 09:04:37 +00:00
actually support command substitutions in strToArgs
This commit is contained in:
parent
5246630d6f
commit
2a91fce083
1 changed files with 5 additions and 1 deletions
|
|
@ -1355,7 +1355,7 @@ clite.lib = {
|
|||
path = '/'+parts.join('/');
|
||||
return path;
|
||||
},
|
||||
// convert a string into an argument array: 'ls /etc' -> ['ls','/etc']
|
||||
// convert a string into an argument array: 'ls /etc' -> ['ls','/etc'], supports "quoted arguments" and `command substitutions`
|
||||
strToArgs:function(txt) {
|
||||
var parts = [];
|
||||
var sp = '';
|
||||
|
|
@ -1377,8 +1377,12 @@ clite.lib = {
|
|||
if (!q) {
|
||||
sp = txt[i];
|
||||
q = true;
|
||||
if (sp == '`');
|
||||
s += '`';
|
||||
break;
|
||||
}else if (txt[i] == sp) {
|
||||
if (sp == '`');
|
||||
s += '`';
|
||||
sp = '';
|
||||
q = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue