Commit 772ff6da authored by Andrew Price's avatar Andrew Price
Browse files

Give users warning that mwscript is going away

parent 68bb2940
Loading
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -49,6 +49,13 @@ void perms_restore(void)
	}
}

static void warn_of_mwscript_death(const char *filename)
{
	// Slightly obnoxious by design
	printf("*** You are using mwscript scripts: %s\n", filename);
	printf("*** mwscript support will be removed from mw on April 7th 2019.\n");
}

static int ReadInitFile(const char *base, const char *filename)
{
	FILE *file;
@@ -57,6 +64,7 @@ static int ReadInitFile(const char *base, const char *filename)
	char *a, *b, *c;
	int lineno;
	struct stat stats;
	static int do_warn = 0;

	if (strncasecmp(filename, "http://", 7)==0
	||  strncasecmp(filename, "https://", 8)==0) {
@@ -117,6 +125,13 @@ static int ReadInitFile(const char *base, const char *filename)
		return 0; // changed because if an error occured after this point the file exists, the js code has reported the error to the user and returning 1 will report to them that it doesn't exist
	}

	/* Warnings for the initial .mwrc are a little OTT for now but warn on
	   subsequent mwscript loads */
	if (do_warn)
		warn_of_mwscript_death(filename);
	else
		do_warn = 1;

	lineno=0;
	while (!feof(file))
	{