summaryrefslogtreecommitdiffstats
path: root/warp/filexp
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2020-11-09 23:37:05 +0000
committerkamil <kamil@NetBSD.org>2020-11-09 23:37:05 +0000
commita931697f3be302466855163a7e216ffee7766445 (patch)
tree0ac2ab10bd68f8317dcf403536f0d612730ef35c /warp/filexp
parent6d16c3b48f5f1f377e2be346c1189d9f8edac22d (diff)
downloadbsdgames-darwin-a931697f3be302466855163a7e216ffee7766445.tar.gz
bsdgames-darwin-a931697f3be302466855163a7e216ffee7766445.tar.zst
bsdgames-darwin-a931697f3be302466855163a7e216ffee7766445.zip
Add Warp Kit, Version 7.0 by Larry Wall
Warp is a real-time space war game that doesn't get boring very quickly. Read warp.doc and the manual page for more information. games/warp originally distributed with 4.3BSD-Reno, is back to the BSD world via NetBSD. Its remnants were still mentioned in games/Makefile. Larry Wall, the original author and the copyright holder, generously donated the game and copyright to The NetBSD Foundation, Inc. Import the game sources as-is from 4.3BSD-Reno, with the cession of the copyright and license to BSD-2-clause NetBSD-style. Signed-off-by: Larry Wall <larry@wall.org> Signed-off-by: Kamil Rytarowski <kamil@netbsd.org>
Diffstat (limited to 'warp/filexp')
-rw-r--r--warp/filexp32
1 files changed, 32 insertions, 0 deletions
diff --git a/warp/filexp b/warp/filexp
new file mode 100644
index 00000000..b0d65435
--- /dev/null
+++ b/warp/filexp
@@ -0,0 +1,32 @@
+#!/bin/sh
+: expand filename
+case "$1" in
+ ~/*|~)
+ echo $1 | sed "s|~|${HOME-$LOGDIR}|"
+ ;;
+ ~*)
+ if /bin/test -f /bin/csh; then
+ /bin/csh -f -c "glob $1"
+ echo ""
+ else
+ name=`expr x$1 : '..\([^/]*\)'`
+ dir=`sed -n -e "/^${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'$'"/\1/" -e p -e q -e '}' </etc/passwd`
+ if /bin/test ! -d "$dir"; then
+ me=`basename $0`
+ echo "$me: can't locate home directory for: $name" >&2
+ exit 1
+ fi
+ case "$1" in
+ */*)
+ echo $dir/`expr x$1 : '..[^/]*/\(.*\)'`
+ ;;
+ *)
+ echo $dir
+ ;;
+ esac
+ fi
+ ;;
+*)
+ echo $1
+ ;;
+esac