diff --git a/Language/Preprocessor/Cpphs/CppIfdef.hs b/Language/Preprocessor/Cpphs/CppIfdef.hs
--- a/Language/Preprocessor/Cpphs/CppIfdef.hs
+++ b/Language/Preprocessor/Cpphs/CppIfdef.hs
@@ -74,9 +74,9 @@
 cpp p syms path options (Keep ps) (l@('#':x):xs) =
     let ws = words x
         cmd = if null ws then "" else head ws
-        line = tail ws
-        sym  = head (tail ws)
-        rest = tail (tail ws)
+        line = if null ws then [] else tail ws
+        sym  = if null line then "" else head line
+        rest = if null line then [] else tail line
         def = defineMacro options (sym++" "++ maybe "1" id (un rest))
         un v = if null v then Nothing else Just (unwords v)
         keepIf b = if b then Keep (p:ps) else Drop 1 False (p:ps)
diff --git a/cpphs.cabal b/cpphs.cabal
--- a/cpphs.cabal
+++ b/cpphs.cabal
@@ -1,5 +1,5 @@
 Name: cpphs
-Version: 1.20.5
+Version: 1.20.6
 Copyright: 2004-2017, Malcolm Wallace
 License: LGPL
 License-File: LICENCE-LGPL
diff --git a/cpphs.hs b/cpphs.hs
--- a/cpphs.hs
+++ b/cpphs.hs
@@ -21,7 +21,7 @@
 import Data.List   ( isPrefixOf )
 
 version :: String
-version = "1.20.5"
+version = "1.20.6"
 
 main :: IO ()
 main = do
diff --git a/docs/index.html b/docs/index.html
--- a/docs/index.html
+++ b/docs/index.html
@@ -198,11 +198,11 @@
 <b>Current stable version:</b>
 
 <p>
-cpphs-1.20.5, release date 2017-04-11<br>
+cpphs-1.20.6, release date 2017-06-21<br>
 By HTTP:
 <a href="http://hackage.haskell.org/package/cpphs">Hackage</a>.
 <ul>
-<li> (1.20.5) reverts the changes in 1.20.4
+<li> (1.20.6) minor bugfix to avoid a crash in an obscure corner case
 </ul>
 
 <p>
@@ -224,6 +224,14 @@
 
 <p>
 <b>Older versions:</b>
+
+<p>
+cpphs-1.20.6, release date 2017-06-21<br>
+By HTTP:
+<a href="http://hackage.haskell.org/package/cpphs">Hackage</a>.
+<ul>
+<li> (1.20.6) minor bugfix to avoid a crash in an obscure corner case
+</ul>
 
 <p>
 cpphs-1.20.5, release date 2017-04-11<br>
