more robust org-babel-chomp

This commit is contained in:
Eric Schulte 2009-06-10 16:17:04 -07:00
parent 9c70974391
commit 23c61abf90
1 changed files with 1 additions and 1 deletions

View File

@ -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)