Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Oct 2010 21:44:43 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r214538 - head/bin/sh
Message-ID:  <201010292144.o9TLihVc060022@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Fri Oct 29 21:44:43 2010
New Revision: 214538
URL: http://svn.freebsd.org/changeset/base/214538

Log:
  sh: Tweak some string constants to reduce code size.
  
  * Reduce some needless differences.
  * Shorten some error messages that should not happen.

Modified:
  head/bin/sh/eval.c
  head/bin/sh/histedit.c
  head/bin/sh/parser.c
  head/bin/sh/var.c

Modified: head/bin/sh/eval.c
==============================================================================
--- head/bin/sh/eval.c	Fri Oct 29 21:29:43 2010	(r214537)
+++ head/bin/sh/eval.c	Fri Oct 29 21:44:43 2010	(r214538)
@@ -1130,7 +1130,7 @@ commandcmd(int argc, char **argv)
 		return typecmd_impl(2, argv - 1, cmd, path);
 	}
 	if (argc != 0)
-		error("commandcmd() called while it should not be");
+		error("commandcmd bad call");
 
 	/*
 	 * Do nothing successfully if no command was specified;

Modified: head/bin/sh/histedit.c
==============================================================================
--- head/bin/sh/histedit.c	Fri Oct 29 21:29:43 2010	(r214537)
+++ head/bin/sh/histedit.c	Fri Oct 29 21:44:43 2010	(r214538)
@@ -297,7 +297,7 @@ histcmd(int argc, char **argv)
 		laststr = argv[1];
 		break;
 	default:
-		error("too many args");
+		error("too many arguments");
 	}
 	/*
 	 * Turn into event numbers.
@@ -329,7 +329,7 @@ histcmd(int argc, char **argv)
 		editfile = editfilestr;
 		if ((efp = fdopen(fd, "w")) == NULL) {
 			close(fd);
-			error("can't allocate stdio buffer for temp");
+			error("Out of space");
 		}
 	}
 

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Fri Oct 29 21:29:43 2010	(r214537)
+++ head/bin/sh/parser.c	Fri Oct 29 21:44:43 2010	(r214538)
@@ -1738,7 +1738,7 @@ getprompt(void *unused __unused)
 	char *fmt;
 	const char *pwd;
 	int i, trim;
-	static char internal_error[] = "<internal prompt error>";
+	static char internal_error[] = "??";
 
 	/*
 	 * Select prompt format.

Modified: head/bin/sh/var.c
==============================================================================
--- head/bin/sh/var.c	Fri Oct 29 21:29:43 2010	(r214537)
+++ head/bin/sh/var.c	Fri Oct 29 21:44:43 2010	(r214538)
@@ -826,7 +826,7 @@ setvarcmd(int argc, char **argv)
 	else if (argc == 3)
 		setvar(argv[1], argv[2], 0);
 	else
-		error("List assignment not implemented");
+		error("too many arguments");
 	return 0;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010292144.o9TLihVc060022>