[mw-devel] [Git][arthur/mw][master] Give users warning that mwscript is going away
Andrew Price
welshbyte at sucs.org
Thu Nov 9 10:04:29 GMT 2017
Andrew Price pushed to branch master at Justin Mitchell / mw
Commits:
772ff6da by Andrew Price at 2017-11-09T10:02:05+00:00
Give users warning that mwscript is going away
- - - - -
1 changed file:
- src/client/init.c
Changes:
=====================================
src/client/init.c
=====================================
--- a/src/client/init.c
+++ b/src/client/init.c
@@ -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))
{
View it on GitLab: https://projects.sucs.org/arthur/mw/commit/772ff6da563f3d852eefc99e2b55f35aa7b2c3e7
---
View it on GitLab: https://projects.sucs.org/arthur/mw/commit/772ff6da563f3d852eefc99e2b55f35aa7b2c3e7
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20171109/7119b288/attachment-0001.html>
More information about the mw-devel
mailing list