Commit 83997ca7 authored by David Byers's avatar David Byers
Browse files

Catch all errors reading user area

Skip newlines between strings in the user area
parent e8c97a05
1999-12-02 David Byers <davby@sen2.ida.liu.se>
* flags.el (lyskom-read-options-eval-get-holerith): Skip newlines
too.
(lyskom-read-options-eval): Surround everything with a catch-all
error handler or we won't be able to log in if the user area is
broken.
1999-12-01 David Byers <davby@ida.liu.se> 1999-12-01 David Byers <davby@ida.liu.se>
* compatibility.el (decode-coding-string, encode-coding-string): * compatibility.el (decode-coding-string, encode-coding-string):
......
...@@ -351,6 +351,7 @@ If successful then set the buffer not-modified. Else print a warning." ...@@ -351,6 +351,7 @@ If successful then set the buffer not-modified. Else print a warning."
(defun lyskom-read-options-eval (text) (defun lyskom-read-options-eval (text)
"Handles the call from where we have the text." "Handles the call from where we have the text."
(condition-case nil
(if text ;+++ Other error handler (if text ;+++ Other error handler
(let* ((lyskom-options-text (text->text-mass text)) (let* ((lyskom-options-text (text->text-mass text))
(pointers (lyskom-read-options-eval-get-holerith t)) (pointers (lyskom-read-options-eval-get-holerith t))
...@@ -435,12 +436,14 @@ If successful then set the buffer not-modified. Else print a warning." ...@@ -435,12 +436,14 @@ If successful then set the buffer not-modified. Else print a warning."
(while (stringp (cdr (car (cdr pos)))) (while (stringp (cdr (car (cdr pos))))
(setq pos (cdr pos))) (setq pos (cdr pos)))
(setcdr pos nil)))))) (setcdr pos nil))))))
(error (lyskom-message (lyskom-get-string 'error-in-options)
(lyskom-get-string 'cancelled))))
(setq lyskom-options-done t)) (setq lyskom-options-done t))
(defun lyskom-read-options-eval-get-holerith (&optional no-coding) (defun lyskom-read-options-eval-get-holerith (&optional no-coding)
(let ((coding (if no-coding 'raw-text lyskom-server-coding-system))) (let ((coding (if no-coding 'raw-text lyskom-server-coding-system)))
(while (string-match "\\s-" (substring lyskom-options-text 0 1)) (while (string-match "\\(\\s-\\|[\n\r]\\)" (substring lyskom-options-text 0 1))
(setq lyskom-options-text (substring lyskom-options-text 1))) (setq lyskom-options-text (substring lyskom-options-text 1)))
;; Read the explicit coding, if any ;; Read the explicit coding, if any
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment