gawk

[old] Sed-like interface to the Gopher protocol
Log | Files | Refs | LICENSE

commit 9e89b90aa01feaae6d3b31a86fc25cb84cf9ef91
parent 20cfe910ceadf3f1dbddcc08fdcb99294b9acfd2
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Tue,  5 Jan 2021 22:44:35 -0800

Add better support for error (3) type

Print error type with the warn() function and host information.

Diffstat:
Mcommand.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/command.c b/command.c @@ -125,6 +125,8 @@ cprint(int argc, char const **argv, int ino, char const **item) if (**item == 'i') printf(" %s\n", item[GI_INFO] + 1); + else if (**item == '3') + warn(0, "'%s': %s\n", item[GI_HOST], item[GI_INFO] + 1); else printf("%4d [%c] %s\n", ino, item[GI_INFO][0], item[GI_INFO] + 1); @@ -134,7 +136,7 @@ cprint(int argc, char const **argv, int ino, char const **item) int cprintv(int argc, char const **argv, int ino, char const **item) { - if (**item != 'i') + if (**item != 'i' && **item != '3') printf("\n %s%s\n", item[GI_HOST], item[GI_PATH]); return cprint(argc, argv, ino, item); }