summaryrefslogtreecommitdiff
path: root/lisp/textmodes/css-mode.el
diff options
context:
space:
mode:
authorSimen Heggestøyl <simenheg@gmail.com>2017-12-16 09:37:11 +0100
committerSimen Heggestøyl <simenheg@gmail.com>2017-12-16 09:46:54 +0100
commit63b6281fdd9c00c6d968e936289c1e32aa9d0dd3 (patch)
treea326fb5cd3db2c34bfa6b154d5b47bf506f55cb7 /lisp/textmodes/css-mode.el
parent804b37ca63ecd68c5359febbedbec120c06918af (diff)
downloademacs-63b6281fdd9c00c6d968e936289c1e32aa9d0dd3.tar.gz
Fix off-by-one error in 'css--hex-color'
* lisp/textmodes/css-mode.el (css--hex-color): Fix off-by-one error. * test/lisp/textmodes/css-mode-tests.el (css-test-hex-color): New test for 'css--hex-color'.
Diffstat (limited to 'lisp/textmodes/css-mode.el')
-rw-r--r--lisp/textmodes/css-mode.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 1de4ff0fca9..f2481da8aa1 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -1037,7 +1037,7 @@ This recognizes CSS-color-4 extensions."
STR is the incoming CSS hex color.
This function simply drops any transparency."
;; Either #RGB or #RRGGBB, drop the "A" or "AA".
- (if (> (length str) 4)
+ (if (> (length str) 5)
(substring str 0 7)
(substring str 0 4)))