Re: x265-4.2 sed patch incorrectly expands '&' characters
"Joe Locash" ([email protected] via blfs-dev Mailing List) <[email protected]> Fri, 1 May 2026 13:17:54 -0400
| Newsgroups | gmane.linux.lfs.beyond.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format... ------------=_1777655883-1253-27696 Content-Type: multipart/alternative; boundary="------------HTcAXMnFzY1mpR9uxhyiWWIC" Content-Language: en-US This is a multi-part message in MIME format. --------------HTcAXMnFzY1mpR9uxhyiWWIC Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/1/26 8:01 AM, Attilio Pavone ([email protected] via blfs-dev Mailing List) wrote: > > Hello, > > while following the (Development) BLFS instructions for building x265-4.2 > https://linuxfromscratch.org/blfs/view/svn/multimedia/x265.html > > I noticed a possible issue in the suggested sed patch: > |sed -i 's/FORMAT_ELF/UNIX64 && FORMAT_ELF/' source/common/x86/cpu-a.asm| > > Since '&' in sed represents the entire matched pattern, this resulted > in the following line: > |%elif UNIX64 FORMAT_ELFFORMAT_ELF FORMAT_ELF| > > instead of the presumably intended: > |%elif UNIX64 && FORMAT_ELF| > > The following escaped form should avoid the issue: > |sed -i 's/FORMAT_ELF/UNIX64 \&\& FORMAT_ELF/' > source/common/x86/cpu-a.asm| > > Thank you for the invaluable guidance provided in building my system, > best regards, > > Attilio (tilly) Pavone > Thanks for the report. Fixed at c28b4f047e. --------------HTcAXMnFzY1mpR9uxhyiWWIC Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div class="moz-cite-prefix">On 5/1/26 8:01 AM, Attilio Pavone (<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a> via blfs-dev Mailing List) wrote:<br> </div> <blockquote type="cite" cite="mid:[email protected]"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <div style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; color: rgb(209, 205, 199); font-family: Arial; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 26, 27); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"> <p style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; margin-top: 0px; margin-bottom: 1rem;">Hello,</p> <p style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; margin-top: 0px; margin-bottom: 1rem;">while following the (Development) BLFS instructions for building x265-4.2 <br> <a class="moz-txt-link-freetext" href="https://linuxfromscratch.org/blfs/view/svn/multimedia/x265.html" moz-do-not-send="true">https://linuxfromscratch.org/blfs/view/svn/multimedia/x265.html</a> </p> <p style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; margin-top: 0px; margin-bottom: 1rem;">I noticed a possible issue in the suggested sed patch: <br> <code style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: inherit; color: inherit; overflow-wrap: break-word; word-break: normal;">sed -i 's/FORMAT_ELF/UNIX64 && FORMAT_ELF/' source/common/x86/cpu-a.asm</code></p> <p style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; margin-top: 0px; margin-bottom: 1rem;">Since '&' in sed represents the entire matched pattern, this resulted in the following line:<br> <code style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: inherit; color: inherit; overflow-wrap: break-word; word-break: normal;">%elif UNIX64 FORMAT_ELFFORMAT_ELF FORMAT_ELF</code></p> <p style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; margin-top: 0px; margin-bottom: 1rem;">instead of the presumably intended:<br> <code style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: inherit; color: inherit; overflow-wrap: break-word; word-break: normal;">%elif UNIX64 && FORMAT_ELF</code></p> <p style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; margin-top: 0px; margin-bottom: 1rem;">The following escaped form should avoid the issue:<br> <code style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: inherit; color: inherit; overflow-wrap: break-word; word-break: normal;">sed -i 's/FORMAT_ELF/UNIX64 \&\& FORMAT_ELF/' source/common/x86/cpu-a.asm</code></p> <p style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; margin-top: 0px; margin-bottom: 1rem;">Thank you for the invaluable guidance provided in building my system, best regards,</p> <p style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; margin-top: 0px; margin-bottom: 1rem;">Attil<span data-darkreader-inline-bgcolor="" style="box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgb(221, 221, 221) transparent; background-color: initial; --darkreader-inline-bgcolor: initial;">io (tilly) Pavone</span></p> </div> </blockquote> Thanks for the report. Fixed at c28b4f047e. </body> </html> --------------HTcAXMnFzY1mpR9uxhyiWWIC-- ------------=_1777655883-1253-27696 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- http://lists.linuxfromscratch.org/sympa/info/blfs-dev Unsubscribe: See the above information page ------------=_1777655883-1253-27696--