Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what: -s flag prints out of order #753

Merged
merged 1 commit into from
Oct 4, 2024
Merged

Commits on Oct 3, 2024

  1. what: -s flag prints out of order

    * -s flag means to stop searching the current file argument, and move to the next file argument, after the first match
    * Input loop reads lines, and a line might contain NUL
    * NUL is expected to terminate patterns in the same way as newline, but NUL was only handled correctly if -s flag was not set
    * I found this when comparing the output with and without -s
    
    %perl strings /usr/bin/cvs | perl grep -Fi miros  # string order = lowercase miros 1st
    @(#)rcsid_bron: $miros: src/gnu/usr.bin/cvs/lib/getdate.y,v 1.14 2021/01/30 02:28:27 tg Exp $
    @(#)rcsid_code: $MirOS: src/gnu/usr.bin/cvs/lib/getdate.c,v 1.19 2021/01/30 02:30:17 tg Exp $
    %perl what /usr/bin/cvs # all matches
    /usr/bin/cvs:
            rcsid_bron: $miros: src/gnu/usr.bin/cvs/lib/getdate.y,v 1.14 2021/01/30 02:28:27 tg Exp $
            rcsid_code: $MirOS: src/gnu/usr.bin/cvs/lib/getdate.c,v 1.19 2021/01/30 02:30:17 tg Exp $
    %perl what -s /usr/bin/cvs # one match (patch applied)
    /usr/bin/cvs:
            rcsid_bron: $miros: src/gnu/usr.bin/cvs/lib/getdate.y,v 1.14 2021/01/30 02:28:27 tg Exp $
    mknos authored Oct 3, 2024
    Configuration menu
    Copy the full SHA
    accc008 View commit details
    Browse the repository at this point in the history