GitLab Commit is coming up on August 3-4. Learn how to innovate together using GitLab, the DevOps platform. Register for free: gitlabcommitvirtual2021.com

  1. 25 Jul, 2021 2 commits
    • Ron Yorston's avatar
      Update README · c79f1302
      Ron Yorston authored
      c79f1302
    • Ron Yorston's avatar
      win32: special case for devices files in stat(2) · 15fcbd19
      Ron Yorston authored
      The diff applet calls stat(2) on the files it's asked to process.
      This includes /dev/null when the -N flag is used and /dev/fd/*
      files when process substitution is used.
      
      Treat device files as a special case in get_file_attr(), returning
      a fake set of attributes with FILE_ATTRIBUTE_DEVICE set.  This
      value is unused elsewhere in busybox-w32.  Ensure it's unset in
      other cases.
      
      When FILE_ATTRIBUTE_DEVICE is set:
      
      - adjust some permissions;
      
      - avoid calling has_exec_format() as this opens/closes the file
        which breaks process substitution.
      
      These changes improve the behaviour of diff but they also have other
      effects.  For example, the stat and ls applets now report details of
      device files.  There may be unintended consequences.
      15fcbd19
  2. 24 Jul, 2021 2 commits
  3. 22 Jul, 2021 2 commits
  4. 20 Jul, 2021 1 commit
  5. 17 Jul, 2021 3 commits
  6. 14 Jul, 2021 4 commits
  7. 13 Jul, 2021 8 commits
    • Ron Yorston's avatar
      vi: fix regex search compilation error · e6f4145f
      Ron Yorston authored
      
      
      Building with FEATURE_VI_REGEX_SEARCH enabled fails.
      Signed-off-by: Ron Yorston's avatarRon Yorston <rmy@pobox.com>
      Signed-off-by: aldot's avatarBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
      e6f4145f
    • Denys Vlasenko's avatar
    • Ron Yorston's avatar
      vi: allow delimiter in ':s' to be escaped · 27592014
      Ron Yorston authored
      
      
      When regular expressions are allowed in search commands it becomes
      possible to escape the delimiter in search/replace commands.  For
      example, this command will replace '/abc' with '/abc/':
      
         :s/\/abc/\/abc\//g
      
      The code to split the command into 'find' and 'replace' strings
      should allow for this possibility.
      
      VI_REGEX_SEARCH isn't enabled by default.  When it is:
      
      function                                             old     new   delta
      strchr_backslash                                       -      38     +38
      colon                                               4378    4373      -5
      ------------------------------------------------------------------------------
      (add/remove: 1/0 grow/shrink: 0/1 up/down: 38/-5)              Total: 33 bytes
      Signed-off-by: Ron Yorston's avatarRon Yorston <rmy@pobox.com>
      Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
      27592014
    • Denys Vlasenko's avatar
      vi: allow regular expressions in ':s' commands · 95ac4a48
      Denys Vlasenko authored
      
      
      BusyBox vi has never supported the use of regular expressions in
      search/replace (':s') commands.  Implement this using GNU regex
      when VI_REGEX_SEARCH is enabled.
      
      The implementation:
      
      - uses basic regular expressions, to match those used in the search
        command;
      
      - only supports substitution of back references ('\0' - '\9') in the
        replacement string.  Any other character following a backslash is
        treated as that literal character.
      
      VI_REGEX_SEARCH isn't enabled in the default build.  In that case:
      
      function                                             old     new   delta
      colon                                               4036    4033      -3
      ------------------------------------------------------------------------------
      (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3)               Total: -3 bytes
      
      When VI_REGEX_SEARCH is enabled:
      
      function                                             old     new   delta
      colon                                               4036    4378    +342
      .rodata                                           108207  108229     +22
      ------------------------------------------------------------------------------
      (add/remove: 0/0 grow/shrink: 2/0 up/down: 364/0)             Total: 364 bytes
      
      v2: Rebase.  Code shrink.  Ensure empty replacement string is null terminated.
      Signed-off-by: default avatarAndrey Dobrovolsky <andrey.dobrovolsky.odessa@gmail.com>
      Signed-off-by: Ron Yorston's avatarRon Yorston <rmy@pobox.com>
      Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
      95ac4a48
    • Ron Yorston's avatar
      vi: improve handling of anchored searches · c76c7874
      Ron Yorston authored
      
      
      Suppose we search for a git conflict marker '<<<<<<< HEAD' using
      the command '/^<<<'.  Using 'n' to go to the next match finds
      '<<<' on the current line, apparently ignoring the '^' anchor.
      
      Set a flag in the compiled regular expression to indicate that the
      start of the string should not be considered a beginning-of-line
      anchor.  An exception has to be made when the search starts from
      the beginning of the file.  Make a similar change for end-of-line
      anchors.
      
      This doesn't affect a default build with VI_REGEX_SEARCH disabled.
      When it's enabled:
      
      function                                             old     new   delta
      char_search                                          247     285     +38
      Signed-off-by: Ron Yorston's avatarRon Yorston <rmy@pobox.com>
      Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
      c76c7874
    • Ron Yorston's avatar
      vi: use basic regular expressions for search · 2916443a
      Ron Yorston authored
      
      
      Both traditional vi and vim use basic regular expressions for
      search.  Also, they don't allow matches to extend across line
      endings.  Thus with the file:
      
         123
         234
      
      the search '/2.*4$' should find the second '2', not the first.
      
      Make BusyBox vi do the same.
      
      Whether or not VI_REGEX_SEARCH is enabled:
      
      function                                             old     new   delta
      ------------------------------------------------------------------------------
      (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0)                 Total: 0 bytes
      Signed-off-by: default avatarAndrey Dobrovolsky <andrey.dobrovolsky.odessa@gmail.com>
      Signed-off-by: Ron Yorston's avatarRon Yorston <rmy@pobox.com>
      Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
      2916443a
    • Ron Yorston's avatar
      vi: allow 'gg' to specify a range · b50ac07c
      Ron Yorston authored
      Commit 7b93e317
      
       (vi: enable 'dG' command. Closes 11801) allowed
      'G' to be used as a range specifier for change/yank/delete
      operations.
      
      Add similar support for 'gg'.  This requires setting the 'cmd_error'
      flag if 'g' is followed by any character other than another 'g'.
      
      function                                             old     new   delta
      do_cmd                                              4852    4860      +8
      .rodata                                           108179  108180      +1
      ------------------------------------------------------------------------------
      (add/remove: 0/0 grow/shrink: 2/0 up/down: 9/0)                 Total: 9 bytes
      Signed-off-by: Ron Yorston's avatarRon Yorston <rmy@pobox.com>
      Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
      b50ac07c
    • Ron Yorston's avatar
      ash, libbb: don't affect POSIX build · dcca23dc
      Ron Yorston authored
      Tweak code to avoid contamination of the POSIX build.  There
      weren't any adverse effects, but better safe than sorry.
      dcca23dc
  8. 12 Jul, 2021 3 commits
  9. 11 Jul, 2021 7 commits
  10. 05 Jul, 2021 2 commits
  11. 03 Jul, 2021 6 commits