emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117350: * play/dunnet.el (dun-doassign): Fixed bug


From: Ron Schnell
Subject: [Emacs-diffs] trunk r117350: * play/dunnet.el (dun-doassign): Fixed bug where UNIX variable assignment without varname or rhs causes crash.
Date: Mon, 16 Jun 2014 05:05:34 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117350
revision-id: address@hidden
parent: address@hidden
committer: Ron Schnell <address@hidden>
branch nick: trunk
timestamp: Mon 2014-06-16 01:05:05 -0400
message:
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/play/dunnet.el            dunnet.el-20091113204419-o5vbwnq5f7feedwu-602
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-06-15 17:45:38 +0000
+++ b/lisp/ChangeLog    2014-06-16 05:05:05 +0000
@@ -1,3 +1,16 @@
+<<<<<<< TREE
+
+2014-06-16  Ron Schnell  <address@hidden>
+
+       * 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  <address@hidden>      
+       * play/dunnet.el If a lamp is in the room, you won't be eaten by a grue.
+       
+=======
 2014-06-15  Michael Albinus  <address@hidden>
 
        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  <address@hidden>
 
        * Makefile.in ($(lisp)/cus-load.el, $(lisp)/finder-inf.el)

=== modified file 'lisp/play/dunnet.el'
--- a/lisp/play/dunnet.el       2014-06-14 20:57:34 +0000
+++ b/lisp/play/dunnet.el       2014-06-16 05:05:05 +0000
@@ -898,7 +898,7 @@
 
 (defun dun-help (args)
   (dun-mprincl
-"Welcome to dunnet (2.01), by Ron Schnell (address@hidden).
+"Welcome to dunnet (2.02), by Ron Schnell (address@hidden - @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 @@
 (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 @@
          (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 @@
                  (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]