Browse Source

Plan 9 from Bell Labs 2005-07-08

David du Colombier 15 years ago
parent
commit
91d1d3e4de

+ 8 - 4
dist/replica/_plan9.db

@@ -7278,7 +7278,7 @@ sys/man/1/filter - 664 sys sys 1041108741 4403
 sys/man/1/fmt - 664 sys sys 1070032221 1557
 sys/man/1/fortune - 664 sys sys 944959673 449
 sys/man/1/freq - 664 sys sys 944959673 735
-sys/man/1/games - 664 sys sys 1118153814 4772
+sys/man/1/games - 664 sys sys 1120737932 5357
 sys/man/1/grap - 664 sys sys 944959675 6417
 sys/man/1/graph - 664 sys sys 944959673 2858
 sys/man/1/grep - 664 sys sys 969512677 2224
@@ -12034,7 +12034,7 @@ sys/src/cmd/ip/httpd/netlib_history.c - 664 sys sys 1015096252 4744
 sys/src/cmd/ip/httpd/redirect.c - 664 sys sys 1042522766 2978
 sys/src/cmd/ip/httpd/save.c - 664 sys sys 1015090172 3175
 sys/src/cmd/ip/httpd/sendfd.c - 664 sys sys 1017679317 12134
-sys/src/cmd/ip/httpd/webls.c - 664 sys sys 1070288192 7269
+sys/src/cmd/ip/httpd/webls.c - 664 sys sys 1120737502 7658
 sys/src/cmd/ip/httpd/webls.denied - 664 sys sys 1064887847 3
 sys/src/cmd/ip/httpd/wikipost.c - 664 sys sys 1083771074 5913
 sys/src/cmd/ip/imap4d - 20000000775 sys sys 988249981 0
@@ -13495,7 +13495,7 @@ sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1015013150 1069
 sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1108827987 20071
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1108827986 1270
-sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1102093207 30350
+sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1120737512 30820
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1067722781 1111
 sys/src/cmd/upas/smtp/smtpd.y - 664 sys sys 1061836986 6949
 sys/src/cmd/upas/smtp/spam.c - 664 sys sys 1098803961 10231
@@ -14679,7 +14679,7 @@ sys/src/libmemdraw/ellipse.c - 664 sys sys 1039752933 4866
 sys/src/libmemdraw/fillpoly.c - 664 sys sys 1039752933 9841
 sys/src/libmemdraw/hwdraw.c - 664 sys sys 944961741 147
 sys/src/libmemdraw/iprint.c - 664 sys sys 969511513 112
-sys/src/libmemdraw/line.c - 664 sys sys 1110918933 11040
+sys/src/libmemdraw/line.c - 664 sys sys 1120737758 11064
 sys/src/libmemdraw/load.c - 664 sys sys 944961742 1495
 sys/src/libmemdraw/mkcmap.c - 664 sys sys 1029430944 1394
 sys/src/libmemdraw/mkfile - 664 sys sys 1045502238 593
@@ -15050,3 +15050,7 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/vncs - 775 sys sys 1120792316 471216
+386/bin/ip/httpd/webls - 775 sys sys 1120792314 131226
+386/bin/upas/smtpd - 775 sys sys 1120792315 328918
+386/lib/libmemdraw.a - 664 sys sys 1120792317 284130

+ 8 - 8
dist/replica/plan9.db

@@ -291,7 +291,7 @@
 386/bin/ip/httpd/netlib_find - 775 sys sys 1115950084 115630
 386/bin/ip/httpd/netlib_history - 775 sys sys 1115950085 114417
 386/bin/ip/httpd/save - 775 sys sys 1115950085 131081
-386/bin/ip/httpd/webls - 775 sys sys 1119496650 130914
+386/bin/ip/httpd/webls - 775 sys sys 1120792314 131226
 386/bin/ip/httpd/wikipost - 775 sys sys 1115950085 112655
 386/bin/ip/imap4d - 775 sys sys 1115950086 236497
 386/bin/ip/ipconfig - 775 sys sys 1116126318 137736
@@ -463,7 +463,7 @@
 386/bin/upas/scanmail - 775 sys sys 1116990557 129045
 386/bin/upas/send - 775 sys sys 1116990558 191823
 386/bin/upas/smtp - 775 sys sys 1119496663 273869
-386/bin/upas/smtpd - 775 sys sys 1116990559 328770
+386/bin/upas/smtpd - 775 sys sys 1120792315 328918
 386/bin/upas/spam - 775 sys sys 1064598366 36
 386/bin/upas/testscan - 775 sys sys 1115950131 83668
 386/bin/upas/token - 775 sys sys 1115950132 77554
@@ -496,7 +496,7 @@
 386/bin/venti/verifyarena - 775 sys sys 1115950139 104270
 386/bin/venti/wrarena - 775 sys sys 1115950140 176179
 386/bin/venti/write - 775 sys sys 1115950140 102499
-386/bin/vncs - 775 sys sys 1119496666 471156
+386/bin/vncs - 775 sys sys 1120792316 471216
 386/bin/vncv - 775 sys sys 1115950142 518017
 386/bin/vt - 775 sys sys 1115950143 173664
 386/bin/vtdump - 775 sys sys 1119496667 159467
@@ -553,7 +553,7 @@
 386/lib/libip.a - 664 sys sys 1116126324 35602
 386/lib/libl.a - 664 sys sys 1115950154 5384
 386/lib/libmach.a - 664 sys sys 1120619355 755696
-386/lib/libmemdraw.a - 664 sys sys 1115950157 283978
+386/lib/libmemdraw.a - 664 sys sys 1120792317 284130
 386/lib/libmemlayer.a - 664 sys sys 1115950157 47360
 386/lib/libmp.a - 664 sys sys 1115950157 79532
 386/lib/libndb.a - 664 sys sys 1115950157 60666
@@ -7278,7 +7278,7 @@ sys/man/1/filter - 664 sys sys 1041108741 4403
 sys/man/1/fmt - 664 sys sys 1070032221 1557
 sys/man/1/fortune - 664 sys sys 944959673 449
 sys/man/1/freq - 664 sys sys 944959673 735
-sys/man/1/games - 664 sys sys 1118153814 4772
+sys/man/1/games - 664 sys sys 1120737932 5357
 sys/man/1/grap - 664 sys sys 944959675 6417
 sys/man/1/graph - 664 sys sys 944959673 2858
 sys/man/1/grep - 664 sys sys 969512677 2224
@@ -12034,7 +12034,7 @@ sys/src/cmd/ip/httpd/netlib_history.c - 664 sys sys 1015096252 4744
 sys/src/cmd/ip/httpd/redirect.c - 664 sys sys 1042522766 2978
 sys/src/cmd/ip/httpd/save.c - 664 sys sys 1015090172 3175
 sys/src/cmd/ip/httpd/sendfd.c - 664 sys sys 1017679317 12134
-sys/src/cmd/ip/httpd/webls.c - 664 sys sys 1070288192 7269
+sys/src/cmd/ip/httpd/webls.c - 664 sys sys 1120737502 7658
 sys/src/cmd/ip/httpd/webls.denied - 664 sys sys 1064887847 3
 sys/src/cmd/ip/httpd/wikipost.c - 664 sys sys 1083771074 5913
 sys/src/cmd/ip/imap4d - 20000000775 sys sys 988249981 0
@@ -13495,7 +13495,7 @@ sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1015013150 1069
 sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1108827987 20071
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1108827986 1270
-sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1102093207 30350
+sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1120737512 30820
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1067722781 1111
 sys/src/cmd/upas/smtp/smtpd.y - 664 sys sys 1061836986 6949
 sys/src/cmd/upas/smtp/spam.c - 664 sys sys 1098803961 10231
@@ -14679,7 +14679,7 @@ sys/src/libmemdraw/ellipse.c - 664 sys sys 1039752933 4866
 sys/src/libmemdraw/fillpoly.c - 664 sys sys 1039752933 9841
 sys/src/libmemdraw/hwdraw.c - 664 sys sys 944961741 147
 sys/src/libmemdraw/iprint.c - 664 sys sys 969511513 112
-sys/src/libmemdraw/line.c - 664 sys sys 1110918933 11040
+sys/src/libmemdraw/line.c - 664 sys sys 1120737758 11064
 sys/src/libmemdraw/load.c - 664 sys sys 944961742 1495
 sys/src/libmemdraw/mkcmap.c - 664 sys sys 1029430944 1394
 sys/src/libmemdraw/mkfile - 664 sys sys 1045502238 593

+ 8 - 0
dist/replica/plan9.log

@@ -19617,3 +19617,11 @@
 1120620638 2 c 386/bin/games/5s - 775 sys sys 1120619353 180356
 1120620638 3 c 386/bin/ndb/dnsquery - 775 sys sys 1120619354 63643
 1120620638 4 c 386/lib/libmach.a - 664 sys sys 1120619355 755696
+1120737663 0 c sys/src/cmd/ip/httpd/webls.c - 664 sys sys 1120737502 7658
+1120737663 1 c sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1120737512 30820
+1120739463 0 c sys/man/1/games - 664 sys sys 1120737932 5357
+1120739463 1 c sys/src/libmemdraw/line.c - 664 sys sys 1120737758 11064
+1120793474 0 c 386/bin/vncs - 775 sys sys 1120792316 471216
+1120793474 1 c 386/bin/ip/httpd/webls - 775 sys sys 1120792314 131226
+1120793474 2 c 386/bin/upas/smtpd - 775 sys sys 1120792315 328918
+1120793474 3 c 386/lib/libmemdraw.a - 664 sys sys 1120792317 284130

+ 48 - 5
sys/man/1/games

@@ -47,6 +47,35 @@ Try to fill complete rows using 4-square or 5-square tiles.
 Move tiles left or right by moving the mouse.
 Rotate tiles with buttons 1 and 3.
 Drop tiles for more points with button 2 or the space bar.
+Move the mouse out of or back into the play area to
+suspend or resume the game.
+Keys
+.LR a
+and 
+.LR j
+move left,
+.LR s
+and 
+.LR k
+rotate left,
+.LR d
+and 
+.LR l
+rotate right,
+.LR f
+and 
+.LR ;
+move right.
+.LR z ,
+.LR p
+and
+.LR Esc
+toggle suspend/resume.
+.LR q ,
+.LR Del
+and
+.LR control-D
+quit.
 .TP
 .B juggle
 Display the juggling
@@ -109,9 +138,9 @@ restarts the current level.
 .LR Del 
 and
 .LR Q
-quit.  The right mouse button invokes a menu to restart the current level, load different level sets, and en- and disable animation of multi-step moves.
-The middle mouse button lets you change between levels. 
-The left mouse button lets you do multi-step moves and pushes,
+quit.  Button 3 invokes a menu to restart the current level, load different level sets, and en- and disable animation of multi-step moves.
+Button 2 lets you change between levels. 
+Button 1 lets you do multi-step moves and pushes,
 by clicking it on the destination where you want Glenda to go.
 Glenda will only move if it can reach the destination.
 For a multi-step push the pebble must be next to Glenda,
@@ -136,7 +165,7 @@ again will deselect that digit.  Clicking on an empty square will then
 affix the square with the selected digit or, if no digit is selected
 empty the square.
 .IP
-The left mouse button presents a menu with the following options:
+Button 3 presents a menu with the following options:
 .RS \w'\fLfireworksXX'u
 .TP \w'\fLOffsetXX'u
 .B New
@@ -172,7 +201,7 @@ pretty-print the board for off-line solving to
 quit the game
 .RE
 .IP
-The middle mouse button presents a list of sudoku boards from
+Button 2 presents a list of sudoku boards from
 .I /sys/games/lib/sudoku/boards
 with varying degree of difficulty.
 .IP
@@ -182,6 +211,12 @@ key quits sudoku
 
 .SH FILES
 .TP
+.B /sys/games/lib/[45]scores
+score files of
+.I 4s
+and
+.I 5s
+.TP
 .B /sys/games/lib/mahjongg/*
 image sprites, levels and backgrounds used by
 .I mahjongg
@@ -195,3 +230,11 @@ images and boards used by
 .I sudoku
 .SH SOURCE
 .B /sys/src/games
+
+.SH BUGS
+In 4s and 5s mouse warping (when the game is resumed,
+and when a new tile appears) does not happen when
+the mouse cursor is outside the game window.
+Those who prefer to use the keyboard without the mouse
+cursor blocking the view (or being warped all the time)
+may consider this a feature.

+ 16 - 4
sys/src/cmd/ip/httpd/webls.c

@@ -197,11 +197,11 @@ static void
 dols(char *dir)
 {
 	Dir	*d;
-	char	*f, *p;
+	char	*f, *p,*nm;
 	long	i, n;
 	int	fd;
 
-	cleanname(dir);
+	cleanname(dir); //  expands "" to "."; ``dir+1'' access below depends on that
 	if (!allowed(dir)) {
 		error("Permission denied", "<p>Cannot list directory %s: Access prohibited</p>", dir);
 		return;
@@ -220,7 +220,19 @@ dols(char *dir)
 	hprint(hout, "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n");
 	hprint(hout, "<head><title>Index of %s</title></head>\n", dir);
 	hprint(hout, "<body>\n");
-	hprint(hout, "<h1>Index of %s</h1>\n", dir);
+	hprint(hout, "<h1>Index of ");
+	nm = dir;
+	while((p = strchr(nm, '/')) != nil){
+		*p = '\0';
+		f = (*dir == '\0') ? "/" : dir;
+		if (!(*dir == '\0' && *(dir+1) == '\0') && allowed(f))
+			hprint(hout, "<a href=\"/magic/webls?dir=%H\">%s/</a>", f, nm);
+		else
+			hprint(hout, "%s/", nm);
+		*p = '/';
+		nm = p+1;
+	}
+	hprint(hout, "%s</h1>\n", nm);
 	n = dirreadall(fd, &d);
 	close(fd);
 	maxwidths(d, n);
@@ -245,7 +257,7 @@ dols(char *dir)
 	}
 	f = smprint("%s/..", dir);
 	cleanname(f);
-	if (allowed(f))
+	if (strcmp(f, dir) != 0 && allowed(f))
 		hprint(hout, "\nGo to <a href=\"/magic/webls?dir=%H\">parent</a> directory\n", f);
 	else
 		hprint(hout, "\nEnd of directory listing\n");

+ 11 - 1
sys/src/cmd/upas/smtp/smtpd.c

@@ -281,7 +281,17 @@ hello(String *himp, int extended)
 			}
 		}
 	}
-		
+	/*
+	 * it is never acceptable to claim to be "localhost",
+	 * "localhost.localdomain" or "localhost.example.com"; only spammers
+	 * do this.  it should be unacceptable to claim any string that doesn't
+	 * look like a domain name (e.g., has at least one dot in it), but
+	 * Microsoft mail software gets this wrong.
+	 */
+	if (strcmp(him, "localhost") == 0 ||
+	    strcmp(him, "localhost.localdomain") == 0 ||
+	    strcmp(him, "localhost.example.com") == 0)
+		goto Liarliar;
 	if(strchr(him, '.') == 0 && nci != nil && strchr(nci->rsys, '.') != nil)
 		him = nci->rsys;
 

+ 1 - 0
sys/src/libmemdraw/line.c

@@ -368,6 +368,7 @@ _memimageline(Memimage *dst, Point p0, Point p1, int end0, int end1, int radius,
 			r.max.y += radius+1;
 		}
 		oclipr = dst->clipr;
+		sp = addpt(r.min, d);
 		dst->clipr = clipr;
 		memimagedraw(dst, r, src, sp, memopaque, sp, op);
 		dst->clipr = oclipr;