mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
/lib/functions.sh: remove strtok()
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40405 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
fbddef3dc9
commit
6fc0daa25c
@ -363,32 +363,6 @@ macaddr_canonicalize()
|
||||
printf "%02x:%02x:%02x:%02x:%02x:%02x" 0x${canon// / 0x} 2>/dev/null
|
||||
}
|
||||
|
||||
strtok() { # <string> { <variable> [<separator>] ... }
|
||||
local tmp
|
||||
local val="$1"
|
||||
local count=0
|
||||
|
||||
shift
|
||||
|
||||
while [ $# -gt 1 ]; do
|
||||
tmp="${val%%$2*}"
|
||||
|
||||
[ "$tmp" = "$val" ] && break
|
||||
|
||||
val="${val#$tmp$2}"
|
||||
|
||||
export ${NO_EXPORT:+-n} "$1=$tmp"; count=$((count+1))
|
||||
shift 2
|
||||
done
|
||||
|
||||
if [ $# -gt 0 -a -n "$val" ]; then
|
||||
export ${NO_EXPORT:+-n} "$1=$val"; count=$((count+1))
|
||||
fi
|
||||
|
||||
return $count
|
||||
}
|
||||
|
||||
|
||||
jffs2_mark_erase() {
|
||||
local part="$(find_mtd_part "$1")"
|
||||
[ -z "$part" ] && {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user