- register char *errmsg = error_message(code);
- strings[3].iov_base = errmsg;
- strings[3].iov_len = strlen(errmsg);
- strings[4].iov_base = " ";
- strings[4].iov_len = 1;
- } else {
- strings[3].iov_len = 0;
- strings[4].iov_len = 0;
+ fputs(error_message(code), stderr);
+ }
+ if (fmt) {
+ _doprnt(fmt, pvar, stderr);
+ }
+ putc('\n', stderr);
+}
+
+
+/* mr_trim_args: passed an argument vector, it will trim any trailing
+ * spaces on the args by writing a null into the string. If an argument
+ * appears to be binary instead of ASCII, it will not be trimmed.
+ */
+
+int mr_trim_args(argc, argv)
+int argc;
+char **argv;
+{
+ register char **arg;
+ register unsigned char *p, *lastch;
+
+ for (arg = argv; argc--; arg++) {
+ for (lastch = p = (unsigned char *) *arg; *p; p++) {
+ /* If any byte in the string has the high bit set, assume
+ * that it is binary and we do not want to trim it.
+ * Setting p = lastch will cause us not to trim the string
+ * when we break out of this inner loop.
+ */
+ if (*p >= 0x80) {
+ p = lastch;
+ break;
+ }
+ if (!isspace(*p))
+ lastch = p;