From eca36e921340e4fe3a0f7797c1a7b6201c32b840 Mon Sep 17 00:00:00 2001 From: Ron Schnell Date: Mon, 16 Jun 2014 01:05:05 -0400 Subject: [PATCH] * play/dunnet.el (dun-doassign): Fixed bug where UNIX variable assignment without varname or rhs causes crash. * play/dunnet.el (dun-ftp): Fixed bug where blank ftp password is allowed, making it impossible to win endgame. * play/dunnet.el (dun-unix-verbs): Added ssh as alias to rlogin, because nobody knows what rlogin is anymore. * play/dunnet.el (dun-help): Bumped version number, updated contact info. --- lisp/ChangeLog | 14 +++++++++ lisp/play/dunnet.el | 72 ++++++++++++++++++++++++++------------------- 2 files changed, 55 insertions(+), 31 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 959f0a26a54..460d6bed0b6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +<<<<<<< TREE + +2014-06-16 Ron Schnell + + * play/dunnet.el (dun-doassign): Fixed bug where UNIX variable assignment without varname or rhs causes crash. + * play/dunnet.el (dun-ftp): Fixed bug where blank ftp password is allowed, making it impossible to win endgame. + * play/dunnet.el (dun-unix-verbs): Added ssh as alias to rlogin, because nobody knows what rlogin is anymore. + * play/dunnet.el (dun-help): Bumped version number, updated contact info. + +2014-06-14 Ron Schnell + * play/dunnet.el If a lamp is in the room, you won't be eaten by a grue. + +======= 2014-06-15 Michael Albinus Sync with Tramp 2.2.10. @@ -132,6 +145,7 @@ * play/dunnet.el (dun-describe-room, dun-mode): If a lamp is in the room, you won't be eaten by a grue. +>>>>>>> MERGE-SOURCE 2014-06-13 Glenn Morris * Makefile.in ($(lisp)/cus-load.el, $(lisp)/finder-inf.el) diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index c82660feffc..3f4b8e8c5b8 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -898,7 +898,7 @@ to swim.") (defun dun-help (args) (dun-mprincl -"Welcome to dunnet (2.01), by Ron Schnell (ronnie@driver-aces.com). +"Welcome to dunnet (2.02), by Ron Schnell (ronnie@driver-aces.com - @RonnieSchnell). Here is some useful information (read carefully because there are one or more clues in here): - If you have a key that can open a door, you do not need to explicitly @@ -1387,8 +1387,8 @@ for a moment, then straighten yourself up. (setq dungeon-mode 'dungeon) (setq dun-unix-verbs '((ls . dun-ls) (ftp . dun-ftp) (echo . dun-echo) (exit . dun-uexit) (cd . dun-cd) (pwd . dun-pwd) - (rlogin . dun-rlogin) (uncompress . dun-uncompress) - (cat . dun-cat))) + (rlogin . dun-rlogin) (ssh . dun-rlogin) + (uncompress . dun-uncompress) (cat . dun-cat))) (setq dun-dos-verbs '((dir . dun-dos-dir) (type . dun-dos-type) (exit . dun-dos-exit) (command . dun-dos-spawn) @@ -2539,25 +2539,31 @@ treasures for points?" "4" "four") (dun-mprincl "Incorrect."))) (let (varname epoint afterq i value) - (setq varname (substring line 0 esign)) - (if (not (setq epoint (string-match ")" line))) - (if (string= (substring line (1+ esign) (+ esign 2)) - "\"") - (progn - (setq afterq (substring line (+ esign 2))) - (setq epoint (+ - (string-match "\"" afterq) - (+ esign 3)))) - - (if (not (setq epoint (string-match " " line))) - (setq epoint (length line)))) - (setq epoint (1+ epoint)) - (while (and - (not (= epoint (length line))) - (setq i (string-match ")" (substring line epoint)))) - (setq epoint (+ epoint i 1)))) - (setq value (substring line (1+ esign) epoint)) - (dun-eval varname value)))) + (setq varname (replace-regexp-in-string " " "" (substring line 0 esign))) + + (if (or (= (length varname) 0) (< (- (length line) esign) 2)) + (progn + (dun-mprinc line) + (dun-mprincl " : not found.")) + + (if (not (setq epoint (string-match ")" line))) + (if (string= (substring line (1+ esign) (+ esign 2)) + "\"") + (progn + (setq afterq (substring line (+ esign 2))) + (setq epoint (+ + (string-match "\"" afterq) + (+ esign 3)))) + + (if (not (setq epoint (string-match " " line))) + (setq epoint (length line)))) + (setq epoint (1+ epoint)) + (while (and + (not (= epoint (length line))) + (setq i (string-match ")" (substring line epoint)))) + (setq epoint (+ epoint i 1)))) + (setq value (substring line (1+ esign) epoint)) + (dun-eval varname value))))) (defun dun-eval (varname value) (let (eval-error) @@ -2741,16 +2747,20 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..") (if dun-batch-mode (dun-mprincl "Login failed.") (dun-mprincl "\nLogin failed.")) - (if dun-batch-mode - (dun-mprincl - "Guest login okay, user access restrictions apply.") - (dun-mprincl - "\nGuest login okay, user access restrictions apply.")) - (dun-ftp-commands) - (setq newlist + (if (= (length ident) 0) + (if dun-batch-mode + (dun-mprincl "Password is required.") + (dun-mprincl "\nPassword is required.")) + (if dun-batch-mode + (dun-mprincl + "Guest login okay, user access restrictions apply.") + (dun-mprincl + "\nGuest login okay, user access restrictions apply.")) + (dun-ftp-commands) + (setq newlist '("What password did you use during anonymous ftp to gamma?")) - (setq newlist (append newlist (list ident))) - (rplaca (nthcdr 1 dun-endgame-questions) newlist))))))))) + (setq newlist (append newlist (list ident))) + (rplaca (nthcdr 1 dun-endgame-questions) newlist)))))))))) (defun dun-ftp-commands () (setq dun-exitf nil) -- 2.39.5