Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: urfave/cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.22.6
Choose a base ref
...
head repository: urfave/cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.22.7
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 22, 2022

  1. Don't call open("") (#1336)

    strings.Split(s, sep) returns a slice of a single element containing s
    if sep is not found in s. This is true even if s is empty.
    
    As a result, every call to flagFromEnvOrFile results in an attempt to
    open a file with empty name. This is seen from strace as
    
    [pid 3287620] openat(AT_FDCWD, "", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid 3287620] openat(AT_FDCWD, "", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    ...
    
    To fix, check if the string is empty before calling ReadFile.
    
    This also fixes cases where filePath is non-empty but has extra commas.
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    (cherry picked from commit 3df9a3c)
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Apr 22, 2022
    Configuration menu
    Copy the full SHA
    0fbd4f5 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1362 from kolyshkin/v1-bad-open

    Don't call open("") backport
    meatballhat authored Apr 22, 2022
    Configuration menu
    Copy the full SHA
    1b4a05e View commit details
    Browse the repository at this point in the history
Loading