Skip to content

[bash] Incomplete path substitution. #5928

@apodtele

Description

@apodtele

Description / Steps to reproduce the issue

When passing a path as an argument, appropriate substitutions are usually made and the program below prints appropriate Windows paths (with C:/...). It fails, however, if the filename contains escaped square bracket. Then C:/ does not get substituted and any further work with the file becomes impossible.

~/fooC:/Users/apodtele/foo and is good to go.
~/bar\[/c/Users/apodtele/bar[ and will fail.

#include <stdio.h>

int main(int argc, char **argv)
{
  if(argc > 1)
    puts(argv[1]);
  return 0;
}

Expected behavior

Both ~/foo and ~/bar\[ are legal and should work. Bash should complete the substitution.

Actual behavior

~/bar\[' is not processed completely; C:/ is not substituted.

Verification

Windows Version

MINGW64_NT_10.0_26200

Are you willing to submit a PR?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions