;;
"${CR}")
if [ $state = dheader ]; then
- sed -n "/--${multipart_boundary}\(--\)\?${CR}/q; p;" \
- | head -c-2
+ # Do not use `sed -n` (or busybox sed will "convert" NULL to LF)
+ sed "/--${multipart_boundary}\(--\)\?${CR}/{x;q;}" \
+ | head -c-3
return 0;
fi
[ $state = header ] && state=junk