Commit Diff


commit - 0afff63a215ca55111f18c1d86ef86b7673cca8e
commit + 76ca4378889d6b4f0a57484f499ef07aabc7e968
blob - 6416f700ed687760ca4a391fde869348b89f9840
blob + 0131d0c2dc2b29c0da7575923f5f205a8868bf19
--- complete.c
+++ complete.c
@@ -1065,7 +1065,7 @@ initedit()
 	editing = 1;
 
 	if (!elc) {
-		elc = el_init(__progname, stdin, stdout, stderr);
+		elc = el_init(getprogname(), stdin, stdout, stderr);
 		if (histc)
 			el_set(elc, EL_HIST, history, histc); /* use history */
 		el_set(elc, EL_EDITOR, "emacs"); /* default type */
@@ -1078,7 +1078,7 @@ initedit()
 		el_set(elc, EL_SIGNAL, 1);
 	}
 	if (!eli) {
-		eli = el_init(__progname, stdin, stdout, stderr);
+		eli = el_init(getprogname(), stdin, stdout, stderr);
 		if (histi)
 			el_set(eli, EL_HIST, history, histi);
 		el_set(eli, EL_EDITOR, "emacs");
@@ -1093,7 +1093,7 @@ initedit()
 		el_set(eli, EL_SIGNAL, 1);
 	}
 	if (!elp) {
-		elp = el_init(__progname, stdin, stdout, stderr);
+		elp = el_init(getprogname(), stdin, stdout, stderr);
 		el_set(elp, EL_EDITOR, "emacs"); /* default type */
 		el_set(elp, EL_PROMPT, pprompt); /* set the prompt
 						  * function */
blob - 6ec08fed8e002091820e76413562211332b40654
blob + 985ec7948a08869736e55a9f66fd385275c9cbf7
--- externs.h
+++ externs.h
@@ -32,7 +32,6 @@ struct rtdump {
 	char *lim;	/* end of routing table */
 };
 
-extern char *__progname;	/* duh */
 extern char *vers;		/* the version of nsh */
 extern char saveline[1024];	/* command line */
 #define NARGS  (sizeof(line)/2)	/* max arguments in char line[] */
blob - ed3d6b6e054eea4ba1775548671e4163bb6ebf41
blob + f1fe7d6526e5195906ff0082f8d42871d1680ec4
--- main.c
+++ main.c
@@ -339,7 +339,8 @@ main(int argc, char *argv[])
 void
 usage(void)
 {
-	fprintf(stderr, "usage: %s [-v] [-i rcfile | -c rcfile]\n", __progname);
+	fprintf(stderr, "usage: %s [-v] [-i rcfile | -c rcfile]\n",
+	    getprogname());
 	fprintf(stderr, "           -v indicates verbose operation\n");
 	fprintf(stderr, "           -i rcfile loads initial system" \
 		    " configuration from rcfile\n");