Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 7, 2018, 11:19 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1811071219350.39@tvgsbejvaqbjf.bet>
- In-Reply-To
- <CACsJy8D47sDgdpmPSqVbBu7Omc1=4yAn895-PE91-PLs9+83bw@mail.gmail.com>
Hi,
On Tue, 6 Nov 2018, Duy Nguyen wrote:
Show 35 quoted lines
> On Tue, Nov 6, 2018 at 3:55 PM Johannes Schindelin via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
> >
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > On Windows, an absolute POSIX path needs to be turned into a Windows
> > one.
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> > path.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/path.c b/path.c
> > index 34f0f98349..a72abf0e1f 100644
> > --- a/path.c
> > +++ b/path.c
> > @@ -11,6 +11,7 @@
> > #include "path.h"
> > #include "packfile.h"
> > #include "object-store.h"
> > +#include "exec-cmd.h"
> >
> > static int get_st_mode_bits(const char *path, int *mode)
> > {
> > @@ -709,6 +710,10 @@ char *expand_user_path(const char *path, int real_home)
> >
> > if (path == NULL)
> > goto return_null;
> > +#ifdef __MINGW32__
> > + if (path[0] == '/')
> > + return system_path(path + 1);
> > +#endif
>
> Should this behavior be documented somewhere, maybe in config.txt?First we need to find a consensus how this should work.
Ciao, Dscho
Show 9 quoted lines
>
> > if (path[0] == '~') {
> > const char *first_slash = strchrnul(path, '/');
> > const char *username = path + 1;
> > --
> > gitgitgadget
> --
> Duy
>