From: erg <devnull@localhost> Date: Thu, 12 Oct 2006 23:10:20 +0000 (+0000) Subject: Fix Windows code to only remove .exe if it exists. Apparently, X-Git-Tag: LAST_LIBGRAPH~32^2~5831 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f04eeaea876865d78e24532b5f53a6a77826258a;p=graphviz Fix Windows code to only remove .exe if it exists. Apparently, versions can now have argv[0] with no trailing .exe. --- diff --git a/lib/common/input.c b/lib/common/input.c index c0b5beac9..9ed8564b8 100644 --- a/lib/common/input.c +++ b/lib/common/input.c @@ -134,7 +134,7 @@ static char* dotneato_basename (char* path) */ { char* dotp = strrchr (s, '.'); - if (dotp) *dotp = '\0'; + if (dotp && !strcmp(dotp+1,"exe")) *dotp = '\0'; } #endif while (*s) s++; s--;