Commits

Michał Górny committed 932f57e

Move argv[0] to named variable.

This is in order to make future changes simpler.

  • Participants
  • Parent commits 6ea5e8c

Comments (0)

Files changed (1)

File src/python-exec.c

 	char* bufp = buf;
 	char* bufpy;
 
-	size_t len = strlen(argv[0]);
+	const char* script = argv[0];
+
+	size_t len = strlen(script);
 
 	/* 2 for the hyphen and the null terminator */
 	if (len + max_epython_len + 2 >= BUFSIZ)
 		if (!bufp)
 		{
 			fprintf(stderr, "%s: memory allocation failed (program name too long).\n",
-					argv[0]);
+					script);
 			return 1;
 		}
 	}
-	memcpy(bufp, argv[0], len);
+	memcpy(bufp, script, len);
 	bufp[len] = '-';
 
 	bufpy = &bufp[len+1];
 	if (bufp != buf)
 		free(bufp);
 	fprintf(stderr, "%s: no supported Python implementation variant found!\n",
-			argv[0]);
+			script);
 	return 127;
 }