[hackers] [sbase] bc: Don't prepend bc in eprintf() || Roberto E. Vargas Caballero
commit 4e3d54e231f17d851ee58031d8e2becf75b81302
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
AuthorDate: Sun Nov 23 11:53:26 2025 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
CommitDate: Sun Nov 23 11:53:26 2025 +0100
bc: Don't prepend bc in eprintf()
Eprintf() currently prepends agrv0 generating a double print
of argv0.
diff --git a/bc.y b/bc.y
index 4130191..37f33e7 100644
--- a/bc.y
+++ b/bc.y
_AT_@ -251,7 +251,7 @@ writeout(char *s)
return;
err:
- eprintf("bc:writing to dc:");
+ eprintf("writing to dc:");
}
static char *
_AT_@ -267,7 +267,7 @@ code(char *fmt, ...)
va_end(va);
if (n < 0 || n >= room)
- eprintf("bc: unable to code requested operation\n");
+ eprintf("unable to code requested operation\n");
s = buff + used;
used += n + 1;
_AT_@ -630,11 +630,11 @@ spawn(void)
char errmsg[] = "bc:error execing dc\n";
if (pipe(fds) < 0)
- eprintf("bc:creating pipe:");
+ eprintf("creating pipe:");
switch (fork()) {
case -1:
- eprintf("bc:forking dc:");
+ eprintf("forking dc:");
case 0:
close(1);
dup(fds[1]);
_AT_@ -664,7 +664,7 @@ init(void)
if (!buff)
buff = malloc(BUFSIZ);
if (!yytext || !buff)
- eprintf("bc: out of memory\n");
+ eprintf("out of memory\n");
}
static int
_AT_@ -688,7 +688,7 @@ bc(char *fname)
if (fname) {
filename = fname;
if (!freopen(fname, "r", stdin))
- eprintf("bc: %s:", fname);
+ eprintf("%s:", fname);
}
for (init(); run(); init())
_AT_@ -725,7 +725,7 @@ loadlib(void)
share:
r = snprintf(fname, sizeof(fname), "%s/share/misc/%s", PREFIX, bclib);
if (r < 0 || r >= sizeof(fname))
- eprintf("bc: invalid path name for bc.library\n");
+ eprintf("invalid path name for bc.library\n");
bc(fname);
}
Received on Sun Nov 23 2025 - 11:56:29 CET
This archive was generated by hypermail 2.3.0
: Sun Nov 23 2025 - 12:00:38 CET