You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the replacement string has a different length than the search pattern, sd either fails with an error "failed to write whole buffer" (when the replacement string is longer) or even leaves behind corrupt files (when the replacement string is shorter).
Thanks a lot for reporting this and your correct analysis @sharkdp. The error was caused by an improper size pre-allocated for the file-backed memory map.
If the replacement string has a different length than the search pattern,
sd
either fails with an error "failed to write whole buffer" (when the replacement string is longer) or even leaves behind corrupt files (when the replacement string is shorter).How to reproduce:
Notice the additional zero byte (
00
) at then end.The text was updated successfully, but these errors were encountered: