diff --git a/cabal2spec.cabal b/cabal2spec.cabal
--- a/cabal2spec.cabal
+++ b/cabal2spec.cabal
@@ -1,5 +1,5 @@
 name:               cabal2spec
-version:            2.7.0
+version:            2.7.1
 synopsis:           Convert Cabal files into rpm spec files
 description:        Convert
                     Cabal files into a
@@ -14,7 +14,7 @@
 license-file:       LICENSE
 author:             Peter Simons, Bryan O'Sullivan, Jens Petersen
 maintainer:         simons@cryp.to
-tested-with:        GHC == 9.2.7, GHC == 9.4.4, GHC == 9.6.1
+tested-with:        GHC == 9.2.8 || == 9.4.8 || == 9.6.4 || == 9.8.2
 category:           Distribution
 homepage:           https://github.com/peti/cabal2spec
 build-type:         Simple
diff --git a/src/Cabal2Spec.hs b/src/Cabal2Spec.hs
--- a/src/Cabal2Spec.hs
+++ b/src/Cabal2Spec.hs
@@ -127,13 +127,10 @@
   let descr = rstrip isSpace (fromShortText (description pkgDesc))
   let descLines = (formatParagraphs . initialCapital . filterSymbols . finalPeriod) $ if badDescription descr then syn' else descr
       finalPeriod cs = if last cs == '.' then cs else cs ++ "."
-      filterSymbols (c:cs) =
-        if c `notElem` "@\\" then c: filterSymbols cs
-        else case c of
-          '@' -> '\'': filterSymbols cs
-          '\\' -> head cs: filterSymbols (tail cs)
-          _ -> c: filterSymbols cs
-      filterSymbols [] = []
+      filterSymbols ('@':cs)    = '\'' : filterSymbols cs
+      filterSymbols ('\\':c:cs) = c : filterSymbols cs
+      filterSymbols (c:cs)      = c : filterSymbols cs
+      filterSymbols []          = []
   when hasLib $
     putDef "pkg_name" name
 
@@ -267,7 +264,7 @@
                         mapM_ (put . (("%{_datadir}/" ++ pkg_name ++ "-%{version}/")++) . avoidSquareBrackets) (sort (dataFiles pkgDesc))
 
       listDirs :: [FilePath] -> [FilePath]
-      listDirs = nub . concatMap (map joinPath . tail . inits) . nub . map init . filter (\p -> length p > 1) . map splitDirectories
+      listDirs = nub . concatMap (map joinPath . drop 1 . inits) . nub . map init . filter (\p -> length p > 1) . map splitDirectories
 
   when hasExecPkg $ do
     put "%files"
