[Mesa-stable] [Mesa-dev] [PATCH 1/2] util: better handle program names from wine

Juan A. Suarez Romero jasuarez at igalia.com
Mon Oct 15 08:43:12 UTC 2018


On Sat, 2018-10-13 at 08:56 +1100, Timothy Arceri wrote:
> Hi guys, can we please get this series applied to 18.2?

Sure. Both patches enqueued for next 18.2 release.


	J.A.

> 
> 
> On 16/8/18 3:36 pm, Timothy Arceri wrote:
> > For some reason wine will sometimes give us a windows style path
> > for an application. For example when running the 64bit version
> > of Rage wine gives a Unix style path, but when running the 32bit
> > version is gives a windows style path.
> > 
> > If we detect no '/' in the path at all it should be safe to
> > assume we have a wine application and instead look for a '\'.
> > ---
> >   src/util/u_process.c | 18 +++++++++++++-----
> >   1 file changed, 13 insertions(+), 5 deletions(-)
> > 
> > diff --git a/src/util/u_process.c b/src/util/u_process.c
> > index 5bf3f56db4e..e8da10ffcad 100644
> > --- a/src/util/u_process.c
> > +++ b/src/util/u_process.c
> > @@ -40,11 +40,19 @@ extern char *program_invocation_name, *program_invocation_short_name;
> >   static const char *
> >   __getProgramName()
> >   {
> > -    char * arg = strrchr(program_invocation_name, '/');
> > -    if (arg)
> > -        return arg+1;
> > -    else
> > -        return program_invocation_name;
> > +   char * arg = strrchr(program_invocation_name, '/');
> > +   if (arg) {
> > +      return arg+1;
> > +   } else {
> > +      /* If there was no '/' at all we likely have a windows like path from
> > +       * a wine application.
> > +       */
> > +      char * arg = strrchr(program_invocation_name, '\\');
> > +      if (arg)
> > +         return arg+1;
> > +
> > +      return program_invocation_name;
> > +   }
> >   }
> >   #    define GET_PROGRAM_NAME() __getProgramName()
> >   #elif defined(__CYGWIN__)
> > 
> 
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable



More information about the mesa-stable mailing list