Commits

trunk
Switch branches/tags
mfwolffe
All time
December 2025
Su Mo Tu We Th Fr Sa
30 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3
4 5 6 7 8 9 10

Commits on December 20, 2025

  1. Fix -F newline splitting and flag interactions
    - Split -F patterns on newlines (each line is an OR alternative)
    - Add count_subpatterns() and split_pattern_on_newlines() helpers
    - Use compiled%count for split pattern count in match_line
    - Fix -c with -l: only print filename when count > 0
    - Fix -o with -c: count mode takes priority over only-matching
    mfwolffe committed
  2. Implement backreference support and Latin-1 case folding
    Backreferences:
    - Add has_backrefs flag to detect patterns with \1-\9
    - Implement backtracking matcher for patterns with backreferences
    - Track captured group start/end positions during matching
    - Support case-insensitive backreference matching
    
    Case folding:
    - Extend to_lower_char() to handle Latin-1 characters (192-222)
    - Add UTF-8 continuation byte handling for Latin Extended-A
    - Enables case-insensitive matching for accented characters (é, ñ, etc.)
    mfwolffe committed
  3. Fix -f pattern file reading
    - Change from formatted to unformatted stream access for byte-by-byte reading
    - Fixes issue where only first pattern was read from pattern files
    - Properly handle newlines across different platforms
    mfwolffe committed
  4. Fix symlink handling for -r option
    - Add is_symlink() function using lstat to detect symbolic links
    - Skip symlinks in collect_files when follow_links is false (-r)
    - Symlinks are followed only with -R (dereference-recursive)
    mfwolffe committed
  5. Preserve CRLF line endings like grep
    - Remove CR stripping from mmap line reading
    - Remove CR stripping from regular file I/O
    - Grep preserves carriage returns in output; ferp now matches
    mfwolffe committed
  6. Fix error exit codes and directory handling
    - Add has_error flag to track errors during file processing
    - Return exit code 2 when errors occur (matching grep behavior)
    - Print error message for directories when -d read is used
    - Add has_error to OpenMP reduction clause for thread safety
    mfwolffe committed
  7. Fix -T tab alignment and line number width
    - Only print tab when there's a prefix (filename, line number, or byte offset)
    - Add line_number_width field to grep_options for dynamic width calculation
    - Pad line numbers based on file size for proper -T alignment
    mfwolffe committed
  8. mfwolffe committed
  9. Enable whitespace pattern test
    The "edge: spaces" test case now passes after fixing whitespace
    pattern handling throughout the codebase.
    mfwolffe committed
  10. Fix alternation pattern parsing with null terminators
    Add null terminators when storing parsed alternatives in the
    Aho-Corasick optimization path. Without this, alternatives like
    "hello" stored in fixed-length arrays would have incorrect lengths.
    mfwolffe committed
  11. Update matcher to use pattern_len for -w/-x options
    Use explicit pattern lengths when applying word boundary (-w) and
    line regexp (-x) transformations. This prevents null terminators
    from being included in the transformed patterns.
    mfwolffe committed
  12. Update regex modules to use pattern_len
    Use pattern_len() instead of len_trim() across regex modules to properly
    handle whitespace patterns. Update Makefile dependencies to ensure
    ferp_kinds is compiled before regex modules that use pattern_len.
    mfwolffe committed
  13. Preserve trailing whitespace in output
    Remove trim() calls when printing matched lines to preserve trailing
    whitespace. This fixes cases where whitespace patterns would not
    display correctly in output.
    mfwolffe committed
  14. Store patterns with null terminators for exact length tracking
    Append null terminators when storing patterns to preserve their exact
    length. This enables correct handling of whitespace-only patterns that
    would otherwise be space-padded in Fortran's fixed-length strings.
    mfwolffe committed
  15. Add pattern_len() function for null-terminated pattern handling
    Fortran's len_trim() returns 0 for whitespace-only strings, which breaks
    patterns like "  " (two spaces). This function respects null terminators
    to track exact pattern length, falling back to full string length when
    no terminator is present.
    mfwolffe committed
  16. mfwolffe committed
  17. mfwolffe committed
  18. mfwolffe committed
  19. mfwolffe committed
  20. mfwolffe committed
  21. mfwolffe committed
  22. mfwolffe committed
  23. mfwolffe committed