$OpenBSD: patch-erts_etc_common_escript_c,v 1.1 2016/06/30 07:18:19 jasper Exp $

Let escript handle versioned binaries.

--- erts/etc/common/escript.c.orig	Tue Jun 21 20:55:58 2016
+++ erts/etc/common/escript.c	Mon Jun 27 11:29:03 2016
@@ -56,7 +56,7 @@ static int eargc;		/* Number of arguments in eargv. */
 #  define DIRSEPSTR "/"
 #  define PATHSEPSTR ":"
 #  define PMAX PATH_MAX
-#  define ERL_NAME "erl"
+#  define ERL_NAME "erl${MAJ_V}"
 #endif
 
 #define UNSHIFT(s) eargc++, eargv--; eargv[0] = QUOTE(s)
@@ -474,7 +474,8 @@ main(int argc, char** argv)
     if ( (_stricmp(basename, "escript.exe") == 0)
        ||(_stricmp(basename, "escript") == 0)) {
 #else
-    if (strcmp(basename, "escript") == 0) {
+   if ( (strcmp(basename, "escript") == 0)
+       ||(strcmp(basename, "escript${MAJ_V}") == 0)) {
 #endif
 	/*
 	 * Locate all options before the script name.
