On Tue, Oct 30, 2018 at 08:11:24AM +0000, Joseph Mayer wrote:
> 
> On a quick sourcecode check I didn't see any code paths e.g.
> "if (argv[0] matches "ksh") { something } else { something else }"
> however I presume I missed something.
> 

yes, the check was too quick, it seems :)

src/bin/ksh/main.c
   134  int
   135  main(int argc, char *argv[])
   136  {
   137          int i;
   138          int argi;
   139          Source *s;
   140          struct block *l;
   141          int restricted, errexit;
   142          char **wp;
   143          struct env env;
   144          pid_t ppid;
   145
   146          kshname = argv[0];
   147
        ...
   236          /* Check to see if we're /bin/sh. */
   237          if (!strcmp(kshname, "sh") || !strcmp(kshname, "-sh") ||
   238              (strlen(kshname) >= 3 &&
   239              !strcmp(&kshname[strlen(kshname) - 3], "/sh"))) {
   240                  Flag(FSH) = 1;
   241                  version_param = "SH_VERSION";
   242          }
   243

-- 
Sebastien Marie

Reply via email to