01mf02 / jaq

A jq clone focussed on correctness, speed, and simplicity
MIT License
2.61k stars 63 forks source link

Passing a value from stdin to jaq without cli args panics #151

Closed tranzystorekk closed 6 months ago

tranzystorekk commented 6 months ago

Tested on jaq 1.2.0:

❯ RUST_BACKTRACE=1 jaq <<< '"foo"'
thread 'main' panicked at jaq-interpret/src/filter.rs:227:16:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: <jaq_interpret::filter::Ref as jaq_interpret::filter::FilterT>::run
   4: <&jaq_interpret::filter::Owned as jaq_interpret::filter::FilterT>::run
   5: jaq::real_main
   6: jaq::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
tranzystorekk commented 6 months ago

Sorry, found out this is a duplicate of #146 which is fixed on main.