mirror of
https://git.sakamoto.pl/laudom/http.sh.git
synced 2025-08-10 15:33:34 +02:00
Compare commits
No commits in common. "93271da824951a6f4969ef2828d83030102ac36d" and "10d19c1a36d93d0df91f8587b757780a01aed5ec" have entirely different histories.
93271da824
...
10d19c1a36
2 changed files with 2 additions and 26 deletions
|
@ -319,13 +319,11 @@ data_yeet() {
|
||||||
|
|
||||||
_sed_sanitize() {
|
_sed_sanitize() {
|
||||||
_trim_control "$1"
|
_trim_control "$1"
|
||||||
# first, replace backslashes with even more backslashes (workaround for sed bug)
|
echo -n "$tr" | xxd -p | tr -d '\n' | sed 's/../\\x&/g'
|
||||||
# then, do the actual sanitization, take whole expr as a hexstring and pass it on.
|
|
||||||
echo -n "$tr" | sed 's/\\/\\\\/g' | xxd -p | tr -d '\n' | sed 's/../\\x&/g'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_sed_sanitize_array() {
|
_sed_sanitize_array() {
|
||||||
echo -n "$1" | sed 's/\\/\\\\/g' | xxd -p | tr -d '\n' | sed 's/../\\x&/g'
|
echo -n "$1" | xxd -p | tr -d '\n' | sed 's/../\\x&/g'
|
||||||
}
|
}
|
||||||
|
|
||||||
# _trim_control(string) -> $tr
|
# _trim_control(string) -> $tr
|
||||||
|
|
|
@ -88,27 +88,6 @@ notORM_replace_oldsyntax() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notORM_backslashes() {
|
|
||||||
tst() {
|
|
||||||
a=('\0meow')
|
|
||||||
data_add "$store" a
|
|
||||||
a=('awawa')
|
|
||||||
data_add "$store" a
|
|
||||||
|
|
||||||
# checks whether data didn't get mangled and can be retrieved
|
|
||||||
data_get "$store" { '\0meow' } || return $?
|
|
||||||
|
|
||||||
# tries to delete the entry, then checks if it got matched
|
|
||||||
data_yeet "$store" { '\0meow' }
|
|
||||||
data_get "$store" { '\0meow' }
|
|
||||||
if [[ $? == 0 ]]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subtest_list=(
|
subtest_list=(
|
||||||
notORM_add_get
|
notORM_add_get
|
||||||
notORM_get_multiline
|
notORM_get_multiline
|
||||||
|
@ -118,5 +97,4 @@ subtest_list=(
|
||||||
notORM_yeet
|
notORM_yeet
|
||||||
notORM_yeet_multiple_filters
|
notORM_yeet_multiple_filters
|
||||||
notORM_replace_oldsyntax
|
notORM_replace_oldsyntax
|
||||||
notORM_backslashes
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue