* xlat/gen.sh (cond_def): Use parameter substitution instead of sed
for xlat line parsing.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
line="$1"; shift
local val
- val="$(printf %s "$line" |
- sed -r -n 's/^([[:alpha:]_][[:alnum:]_]*).*$/\1/p')"
-
- local def
- def="$(printf %s "${line}" |
- sed -r -n 's/^[^[:space:]]+[[:space:]]+([^[:space:]].*)$/\1/p')"
+ val="${line%%[!A-Za-z0-9_]*}"
+
+ local t def=
+ t="${line#*[ ]}"
+ if [ "$line" != "$t" ]; then
+ while [ "$def" != "$t" ]; do
+ def="$t"
+ t="${t##[ ]}"
+ done
+ fi
if [ -n "$def" ]; then
printf "%s\n" \