Skip to content

Commit

Permalink
mingw: allow for longer paths in parse_interpreter()
Browse files Browse the repository at this point in the history
As reported in newren/git-filter-repo#225, it
looks like 99 bytes is not really sufficient to represent e.g. the full
path to Python when installed via Windows Store (and this path is used
in the hasb bang line when installing scripts via `pip`).

Let's increase it to what is probably the maximum sensible path size:
MAX_PATH. This makes `parse_interpreter()` in line with what
`lookup_prog()` handles.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Vilius Šumskas <[email protected]>
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Jan 1, 2025
1 parent 90f39aa commit 0a305bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ static const char *quote_arg_msys2(const char *arg)

static const char *parse_interpreter(const char *cmd)
{
static char buf[100];
static char buf[MAX_PATH];
char *p, *opt;
ssize_t n; /* read() can return negative values */
int fd;
Expand Down

0 comments on commit 0a305bb

Please sign in to comment.