Module Name: src Committed By: jschauma Date: Sun Dec 4 02:42:39 UTC 2022
Modified Files: src/tests/lib/libc/net: t_servent.sh Log Message: whitespace To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/net/t_servent.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libc/net/t_servent.sh diff -u src/tests/lib/libc/net/t_servent.sh:1.2 src/tests/lib/libc/net/t_servent.sh:1.3 --- src/tests/lib/libc/net/t_servent.sh:1.2 Tue Mar 8 08:34:17 2016 +++ src/tests/lib/libc/net/t_servent.sh Sun Dec 4 02:42:39 2022 @@ -1,4 +1,4 @@ -# $NetBSD: t_servent.sh,v 1.2 2016/03/08 08:34:17 joerg Exp $ +# $NetBSD: t_servent.sh,v 1.3 2022/12/04 02:42:39 jschauma Exp $ # # Copyright (c) 2008 The NetBSD Foundation, Inc. # All rights reserved. @@ -41,45 +41,45 @@ servent_body() # (3) prune duplicates # tr '\t' ' ' </etc/services | awk ' - function add(key, name, i, n, ar) { - n = split(names[key], ar); - for (i=1; i<=n; i++) { - if (name == ar[i]) { - return; + function add(key, name, i, n, ar) { + n = split(names[key], ar); + for (i=1; i<=n; i++) { + if (name == ar[i]) { + return; + } } - } - delete ar; - names[key] = names[key] " " name; + delete ar; + names[key] = names[key] " " name; } { - sub("#.*", "", $0); - gsub(" *", " ", $0); - if (NF==0) { - next; - } - add($2, $1, 0); - for (i=3; i<=NF; i++) { - add($2, $i, 1); - } - } - END { - for (key in names) { - portproto = key; - sub("/", ", proto=", portproto); - portproto = "port=" portproto; - - n = split(names[key], ar); - printf "name=%s, %s, aliases=", ar[1], portproto; - for (i=2; i<=n; i++) { - if (i>2) { - printf " "; + sub("#.*", "", $0); + gsub(" *", " ", $0); + if (NF==0) { + next; } - printf "%s", ar[i]; + add($2, $1, 0); + for (i=3; i<=NF; i++) { + add($2, $i, 1); } - printf "\n"; - delete ar; } + END { + for (key in names) { + portproto = key; + sub("/", ", proto=", portproto); + portproto = "port=" portproto; + + n = split(names[key], ar); + printf "name=%s, %s, aliases=", ar[1], portproto; + for (i=2; i<=n; i++) { + if (i>2) { + printf " "; + } + printf "%s", ar[i]; + } + printf "\n"; + delete ar; + } } ' | sort >exp