mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-01-31 00:45:24 +01:00
fix(fs): off by one error in readTextFileLines (#3155)
* fix: off by one error in readTextFileLines (#3154) Signed-off-by: EliasStar <31409841+EliasStar@users.noreply.github.com> * Format and regenerate `api-iife.js` --------- Signed-off-by: EliasStar <31409841+EliasStar@users.noreply.github.com> Co-authored-by: Tony <legendmastertony@gmail.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"fs": patch
|
||||
"fs-js": patch
|
||||
---
|
||||
|
||||
Fix off by one error in the implementation of readTextFileLines causing all lines to end with an (additional) null byte.
|
||||
Issue: [#3154](https://github.com/tauri-apps/plugins-workspace/issues/3154)
|
||||
PR: [#3155](https://github.com/tauri-apps/plugins-workspace/pull/3155)
|
||||
File diff suppressed because one or more lines are too long
@@ -838,7 +838,9 @@ async function readTextFileLines(
|
||||
return { value: null, done }
|
||||
}
|
||||
|
||||
const line = new TextDecoder().decode(bytes.slice(0, bytes.byteLength))
|
||||
const line = new TextDecoder().decode(
|
||||
bytes.slice(0, bytes.byteLength - 1)
|
||||
)
|
||||
|
||||
return {
|
||||
value: line,
|
||||
|
||||
Reference in New Issue
Block a user