From: Bruno Haible Date: Mon, 23 Jun 2025 20:59:47 +0000 (+0200) Subject: build: fix compilation error on OpenBSD and Solaris X-Git-Tag: v9.8~290 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63c040b879dc988c8b38c8ee25289be820c94759;p=thirdparty%2Fcoreutils.git build: fix compilation error on OpenBSD and Solaris * src/speedgen: Use 'printf', not 'sed', to emit code with newlines. --- diff --git a/src/speedgen b/src/speedgen index 56998d6a72..a4af8c8e24 100755 --- a/src/speedgen +++ b/src/speedgen @@ -61,8 +61,9 @@ baud_to_value (speed_t speed) { EOF -sed -e 's/^.*$/# ifdef B&\n case B&: return &;\n# endif/' \ - < "$tmp" >> "$out" +while read n; do + printf '# ifdef B%s\n case B%s: return %s;\n# endif\n' "$n" "$n" "$n" +done < "$tmp" >> "$out" cat >> "$out" <<'EOF' default: return -1; @@ -84,8 +85,9 @@ value_to_baud (unsigned long int value) { EOF -sed -e 's/^.*$/# ifdef B&\n case &: return B&;\n# endif/' \ - < "$tmp" >> "$out" +while read n; do + printf '# ifdef B%s\n case %s: return B%s;\n# endif\n' "$n" "$n" "$n" +done < "$tmp" >> "$out" cat >> "$out" <<'EOF' default: return (speed_t) -1;