$OpenBSD: patch-erts_etc_common_escript_c,v 1.1 2015/06/26 06:35:54 jasper Exp $

Let escript handle versioned binaries.

--- erts/etc/common/escript.c.orig	Tue Jun 23 20:56:21 2015
+++ erts/etc/common/escript.c	Thu Jun 25 13:47:10 2015
@@ -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)
@@ -473,7 +473,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.
