runtime_loader: Fix handling of #!/usr/bin/* introduced in hrev53048

Code was comparing "/usr/bin/" with "/usr/bin/env" of whatever was
passed. We now only compare the substring.

Change-Id: I0d09589fa83227d88fc8ba458eaf4293e86a041b
This commit is contained in:
François Revol 2019-04-08 23:50:33 +02:00
parent 4e8ff93e77
commit 80934b8395

View File

@ -362,7 +362,7 @@ fixup_shebang(char *invoker)
}
// replace /usr/bin/ with /bin/
if (memcmp(commandStart, "/usr/bin/", current - commandStart) == 0)
if (memcmp(commandStart, "/usr/bin/", strlen("/usr/bin/")) == 0)
memmove(commandStart, commandStart + 4, strlen(commandStart + 4) + 1);
}