rename "server" to "host", because this name is used in the RFC - gopher-validator - Simple gopher menu validator. HTML git clone git://bitreich.org/gopher-validator git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-validator DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit a19073d4e019f0a18d854ca2ff1df7d6132d563a DIR parent 512e7771a14a5b12fcbd24d96497fcf5cc999722 HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Thu, 9 Jan 2020 20:13:21 +0100 rename "server" to "host", because this name is used in the RFC Diffstat: M gopher-validator.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) --- DIR diff --git a/gopher-validator.c b/gopher-validator.c @@ -31,7 +31,7 @@ struct visited { int _type; char username[1024]; char path[1024]; - char server[256]; + char host[256]; char port[8]; }; @@ -130,7 +130,7 @@ warning(const char *fmt, ...) } int -isvalidserver(const char *s) +isvalidhost(const char *s) { int colons; @@ -280,13 +280,13 @@ checkdir(FILE *fp) continue; } - /* server */ + /* host */ len = strcspn(line + i, "\t"); - if (len + 1 < sizeof(v.server)) { - memcpy(v.server, line + i, len); - v.server[len] = '\0'; + if (len + 1 < sizeof(v.host)) { + memcpy(v.host, line + i, len); + v.host[len] = '\0'; } else { - error("%zu: server field too long\n", linenr); + error("%zu: host field too long\n", linenr); continue; } if (line[i + len] == '\t') { @@ -347,8 +347,8 @@ checkdir(FILE *fp) } } - if (!isvalidserver(v.server)) - error("%zu: invalid server: %s\n", linenr, v.server); + if (!isvalidhost(v.host)) + error("%zu: invalid host: %s\n", linenr, v.host); /* check port, must be numeric and in range, port 0 is allowed: "Appendix: @@ -420,12 +420,12 @@ checkdir(FILE *fp) } void -checkremote(const char *server, const char *port, const char *path, const char *param) +checkremote(const char *host, const char *port, const char *path, const char *param) { FILE *fp; int fd, r; - fd = edial(server, port); + fd = edial(host, port); if (param[0]) r = dprintf(fd, "%s\t%s\r\n", path, param);