diff options
| author | Agando <roduccomm@gmail.com> | 2026-10-23 18:25:52 +0200 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-10-23 18:25:52 +0200 |
| commit | 7a40846766f3e4dad7c7f72f285e43e06010b218 (patch) | |
| tree | e3b9c78adee9846e32b1d7866848c774c3ad7c69 /modules/core/module-predictor.js | |
| parent | 5d9fb104317f800dff9f01920c3a34fdd4fd9911 (diff) | |
fix(newos4): an invalid grep pattern returns a message, not an exception (v4.6.64)
Packet 8. `new RegExp(pattern)` sat unguarded in the terminal grep handler and in
VFS find()/grep(), so a bad pattern threw out of the command handler into the error
ledger -- the same ledger packet 2 had to stop trusting.
- module-fs.js grep: compile in try/catch, print
"grep: invalid pattern: <pattern> (<engine message>)" as a warning and return
- virtual-fs.js find()/grep(): same guard, return [] and stash the message on
_lastPatternError instead of throwing into the module error wrapper
Verified live on v4.6.64 with the packet's own repro: `grep "/\bug_id\" file` prints
the message, the error counter stays 0 (was: one ledger entry per call), a valid
pattern still matches, and fs.grep('[') returns [] instead of throwing.
Diffstat (limited to 'modules/core/module-predictor.js')
0 files changed, 0 insertions, 0 deletions