This commit is contained in:
Jordan Harband 2024-06-10 15:29:48 -07:00
parent 207465dd36
commit e2f0b5b57c
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56

View File

@ -111,7 +111,7 @@ nvm_json_throw() {
nvm_json_awk_egrep() { nvm_json_awk_egrep() {
local pattern_string local pattern_string
pattern_string=$1 pattern_string="${1}"
awk '{ awk '{
while ($0) { while ($0) {
@ -130,14 +130,14 @@ nvm_json_tokenize() {
local ESCAPE local ESCAPE
local CHAR local CHAR
if echo "test string" | grep -Eo "test" > /dev/null 2>&1; then # if echo "test string" | grep -Eo "test" > /dev/null 2>&1; then
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})' # ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\]' # CHAR='[^[:cntrl:]"\\]'
else # else
GREP=nvm_json_awk_egrep GREP=nvm_json_awk_egrep
ESCAPE='(\\\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})' ESCAPE='(\\\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\\\]' CHAR='[^[:cntrl:]"\\\\]'
fi # fi
local STRING local STRING
STRING="\"${CHAR}*(${ESCAPE}${CHAR}*)*\"" STRING="\"${CHAR}*(${ESCAPE}${CHAR}*)*\""