sed - with `--posix`, `-e 'i\'` takes the next `-e` as its text
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc bài kiểm thử GNU sed compile-errors và đoạn mã compile_text_command_posix được nhắc đến trong issue, sau đó chạy trường hợp tái hiện được cung cấp với --posix. Thêm các trường hợp hồi quy đã nêu cho a\, i\ và c\ tại ranh giới biểu thức. Công việc hoàn tất khi các trường hợp POSIX thất bại với mã thoát 1 và “incomplete command”, trong khi các trường hợp mở rộng GNU vẫn thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
As a GNU extension, sed -e 'i\' -e hello uses the next -e fragment as the
text of a, i or c. With --posix, GNU sed does not join the fragments,
and an a\, i\ or c\ at the end of an -e is an incomplete command.
uutils sed joins them in both modes. The same text in one -f file (i\
followed by hello on the next line) is valid POSIX and works in both
implementations.
The GNU test compile-errors exposes this. Open PR #625 rewrites
compile_text_command_posix, but a build of it still accepts this case.
Reproduction
Rust (incorrect)
$ echo w | ./target/release/sed --posix -e 'i\' -e hello
hello
w
# Exit code: 0
GNU (correct)
$ echo w | sed --posix -e 'i\' -e hello
sed: -e expression #1, char 2: incomplete command
# Exit code: 1
$ echo w | sed -e 'i\' -e hello
hello
w
# Exit code: 0
Test
#[rstest]
#[case::append("a\\")]
#[case::insert("i\\")]
#[case::change("c\\")]
fn test_posix_text_command_stops_at_expression_end(#[case] cmd: &str) {
new_ucmd!()
.args(&["--posix", "-e", cmd, "-e", "second fragment"])
.pipe_in("line\n")
.fails()
.code_is(1)
.no_stdout()
.stderr_contains("incomplete command");
// GNU extension: without --posix the next fragment is the text.
new_ucmd!()
.args(&["-e", cmd, "-e", "second fragment"])
.pipe_in("")
.succeeds()
.no_output();
}
Exposed by the GNU sed test suite: compile-errors.
- Ngôn ngữ chính
- Rust
- Star
- 123
- Fork
- 53
- Merge trung bình
- 2 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 40
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của uutils/sed
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sed - script parser skips CR, VT, FF (and 0x85, 0xA0) as blanks; GNU skips only space and tabCó thể đã có người làm @Himanshu-singh04 đã nhận 22 ngày trước. Đang mởbug gnu-compat good first issue oss-scanner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 89/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sed - with `-s` or `-i`, the file read by `R` is not restarted for each input fileCó thể đã có người làm @Himanshu-singh04 đã nhận 21 ngày trước. Đang mởbug gnu-compat good first issue oss-scanner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sed - output already produced is lost when a runtime error stops processingCó thể đã có người làm @Himanshu-singh04 đã nhận 21 ngày trước. Đang mởbug gnu-compat good first issue oss-scanner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sed - unknown POSIX class names like `[[:foo:]]` or `[[:word:]]` are accepted instead of rejectedCó thể đã có người làm @draarivpatel-ui đã nhận 7 ngày trước. Đang mởbug gnu-compat good first issue oss-scanner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
uutils/sed#646 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
roc-lang/basic-webserver#277 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
samkerrcode/opengent#113 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app bug session
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
backlog
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sagemathinc/sagebrush#3415 ·
Maintainer thường phản hồi trong vòng 1 ngày