Explorar o código

more robust org-babel-chomp

Eric Schulte %!s(int64=16) %!d(string=hai) anos
pai
achega
23c61abf90
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lisp/org-babel.el

+ 1 - 1
lisp/org-babel.el

@@ -363,7 +363,7 @@ This is taken almost directly from `org-read-prop'."
   "Remove any trailing space or carriage returns characters from
 STRING.  Default regexp used is \"[ \f\t\n\r\v]\" but can be
 overwritten by specifying a regexp as a second argument."
-  (while (string-match "[ \f\t\n\r\v]" (substring string -1))
+  (while (and (> (length string) 0) (string-match "[ \f\t\n\r\v]" (substring string -1)))
     (setq string (substring string 0 -1)))
   string)