Issue #8202: Set sys.argv[0] to -m rather than -c while searching for the module to execute. Also updates all the cmd_line_script tests to validate the setting of sys.path[0] and the current working directory
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 7bf2c4c..013f5f1 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1723,6 +1723,10 @@
 }
 #endif
 
+#define _HAVE_SCRIPT_ARGUMENT(argc, argv) \
+  (argc > 0 && argv0 != NULL && \
+   wcscmp(argv0, L"-c") != 0 && wcscmp(argv0, L"-m") != 0)
+  
 void
 PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
 {
@@ -1747,7 +1751,7 @@
         wchar_t link[MAXPATHLEN+1];
         wchar_t argv0copy[2*MAXPATHLEN+1];
         int nr = 0;
-        if (argc > 0 && argv0 != NULL && wcscmp(argv0, L"-c") != 0)
+        if (_HAVE_SCRIPT_ARGUMENT(argc, argv))
             nr = _Py_wreadlink(argv0, link, MAXPATHLEN);
         if (nr > 0) {
             /* It's a symlink */
@@ -1772,7 +1776,7 @@
         }
 #endif /* HAVE_READLINK */
 #if SEP == '\\' /* Special case for MS filename syntax */
-        if (argc > 0 && argv0 != NULL && wcscmp(argv0, L"-c") != 0) {
+        if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) {
             wchar_t *q;
 #if defined(MS_WINDOWS) && !defined(MS_WINCE)
             /* This code here replaces the first element in argv with the full
@@ -1798,7 +1802,7 @@
             }
         }
 #else /* All other filename syntaxes */
-        if (argc > 0 && argv0 != NULL && wcscmp(argv0, L"-c") != 0) {
+        if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) {
 #if defined(HAVE_REALPATH)
             if (_wrealpath(argv0, fullpath)) {
                 argv0 = fullpath;