mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-27 08:19:30 +08:00
Merge pull request #3586 from pmzqla/configure
configure: don't depend on GNU sed
This commit is contained in:
commit
247ba02bb8
5
configure
vendored
5
configure
vendored
@ -5657,8 +5657,11 @@ extract() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# BSD sed needs an actual newline character in the substitute command
|
||||||
|
new_line='
|
||||||
|
'
|
||||||
# Convert " -" to "\n" if not between quotes and remove possible leading white spaces
|
# Convert " -" to "\n" if not between quotes and remove possible leading white spaces
|
||||||
string=$(echo " $*" | $SED -e 's: -:\n:g' -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[:space:]*//')
|
string=$(echo " $*" | $SED -e "s: -:\\${new_line}:g" -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[:space:]*//')
|
||||||
SAVEIFS=$IFS
|
SAVEIFS=$IFS
|
||||||
IFS=$(printf "\n\b")
|
IFS=$(printf "\n\b")
|
||||||
for i in $string; do
|
for i in $string; do
|
||||||
|
@ -222,8 +222,11 @@ extract() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# BSD sed needs an actual newline character in the substitute command
|
||||||
|
new_line='
|
||||||
|
'
|
||||||
# Convert " -" to "\n" if not between quotes and remove possible leading white spaces
|
# Convert " -" to "\n" if not between quotes and remove possible leading white spaces
|
||||||
string=$(echo " $*" | $SED -e 's: -:\n:g' -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[[:space:]]*//')
|
string=$(echo " $*" | $SED -e "s: -:\\${new_line}:g" -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[[:space:]]*//')
|
||||||
SAVEIFS=$IFS
|
SAVEIFS=$IFS
|
||||||
IFS=$(printf "\n\b")
|
IFS=$(printf "\n\b")
|
||||||
for i in $string; do
|
for i in $string; do
|
||||||
|
Loading…
Reference in New Issue
Block a user