logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git
commit: 721b0a5cfe2760a012c2adf1eb222dc3cfdab1ed
parent c40198a25ff835e4daab2401b1f260919aff052c
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat,  7 Dec 2024 04:38:00 +0100

cmd/printf: unifdef -USHELL -m

Diffstat:

Mcmd/printf.c26--------------------------
1 file changed, 0 insertions(+), 26 deletions(-)

diff --git a/cmd/printf.c b/cmd/printf.c @@ -53,12 +53,6 @@ #include <unistd.h> #include <wchar.h> -#ifdef SHELL -#define main printfcmd -#include "bltin/bltin.h" -#include "options.h" -#endif - #define PF(f, func) \ do \ { \ @@ -101,17 +95,10 @@ main(int argc, char *argv[]) size_t len; int end, rval; char *format, *fmt, *start; -#ifndef SHELL int ch; (void)setlocale(LC_ALL, ""); -#endif -#ifdef SHELL - nextopt(""); - argc -= argptr - argv; - argv = argptr; -#else while((ch = getopt(argc, argv, "")) != -1) switch(ch) { @@ -122,7 +109,6 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; -#endif if(argc < 1) { @@ -130,9 +116,6 @@ main(int argc, char *argv[]) return (1); } -#ifdef SHELL - INTOFF; -#endif /* * Basic algorithm is to scan the format string for conversion * specifications -- once one is found, find out if the field @@ -170,9 +153,6 @@ main(int argc, char *argv[]) fmt = printf_doformat(fmt, &rval); if(fmt == NULL || fmt == end_fmt) { -#ifdef SHELL - INTON; -#endif return (fmt == NULL ? 1 : rval); } end = 0; @@ -188,17 +168,11 @@ main(int argc, char *argv[]) if(end == 1) { warnx("missing format character"); -#ifdef SHELL - INTON; -#endif return (1); } fwrite(start, 1, fmt - start, stdout); if(!*gargv) { -#ifdef SHELL - INTON; -#endif return (rval); } /* Restart at the beginning of the format string. */