diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## Changes in 0.31.2
+  - Add default value for maintainer (see #339)
+  - Escape commas and spaces in filenames when generating cabal files
+
 ## Changes in 0.31.1
   - Show the header when printing to stdout (see #331)
   - Add help for `--numeric-version`(see #337)
diff --git a/hpack.cabal b/hpack.cabal
--- a/hpack.cabal
+++ b/hpack.cabal
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: d0e64e7193dd79e7d688f56350272b988a08b6f0f9706767a37f122ceeae72ee
+-- hash: 3d060180293c32b8d0c25b710d0f419e96a6cc6ec3f95ac5e70bb77f44cbafc3
 
 name:           hpack
-version:        0.31.1
+version:        0.31.2
 synopsis:       A modern format for Haskell packages
 description:    See README at <https://github.com/sol/hpack#readme>
 category:       Development
diff --git a/src/Hpack/Config.hs b/src/Hpack/Config.hs
--- a/src/Hpack/Config.hs
+++ b/src/Hpack/Config.hs
@@ -62,6 +62,7 @@
 , CppOption
 , CcOption
 , LdOption
+, Path(..)
 #ifdef TEST
 , renameDependencies
 , Empty(..)
@@ -357,9 +358,9 @@
 type ParseCxxSources = Maybe (List FilePath)
 type ParseJsSources = Maybe (List FilePath)
 
-type CSources = [FilePath]
-type CxxSources = [FilePath]
-type JsSources = [FilePath]
+type CSources = [Path]
+type CxxSources = [Path]
+type JsSources = [Path]
 
 type WithCommonOptions cSources cxxSources jsSources a = Product (CommonOptions cSources cxxSources jsSources a) a
 
@@ -518,7 +519,7 @@
 , packageConfigCategory :: Maybe String
 , packageConfigStability :: Maybe String
 , packageConfigAuthor :: Maybe (List String)
-, packageConfigMaintainer :: Maybe (List String)
+, packageConfigMaintainer :: Maybe (Maybe (List String))
 , packageConfigCopyright :: Maybe (List String)
 , packageConfigBuildType :: Maybe BuildType
 , packageConfigLicense :: Maybe (Maybe String)
@@ -829,9 +830,9 @@
 , packageLicenseFile :: [FilePath]
 , packageTestedWith :: Maybe String
 , packageFlags :: [Flag]
-, packageExtraSourceFiles :: [FilePath]
-, packageExtraDocFiles :: [FilePath]
-, packageDataFiles :: [FilePath]
+, packageExtraSourceFiles :: [Path]
+, packageExtraDocFiles :: [Path]
+, packageDataFiles :: [Path]
 , packageDataDir :: Maybe FilePath
 , packageSourceRepository :: Maybe SourceRepository
 , packageCustomSetup :: Maybe CustomSetup
@@ -877,10 +878,10 @@
 , sectionGhcjsOptions :: [GhcjsOption]
 , sectionCppOptions :: [CppOption]
 , sectionCcOptions :: [CcOption]
-, sectionCSources :: [FilePath]
+, sectionCSources :: [Path]
 , sectionCxxOptions :: [CxxOption]
-, sectionCxxSources :: [FilePath]
-, sectionJsSources :: [FilePath]
+, sectionCxxSources :: [Path]
+, sectionJsSources :: [Path]
 , sectionExtraLibDirs :: [FilePath]
 , sectionExtraLibraries :: [FilePath]
 , sectionExtraFrameworksDirs :: [FilePath]
@@ -1096,7 +1097,7 @@
       , packageCategory = packageConfigCategory
       , packageStability = packageConfigStability
       , packageAuthor = fromMaybeList packageConfigAuthor
-      , packageMaintainer = fromMaybeList packageConfigMaintainer
+      , packageMaintainer = fromMaybeList maintainer
       , packageCopyright = fromMaybeList packageConfigCopyright
       , packageBuildType = fromMaybe defaultBuildType packageConfigBuildType
       , packageLicense = join packageConfigLicense
@@ -1166,6 +1167,12 @@
       where
         fromGithub = (++ "/issues") . sourceRepositoryUrl <$> github
 
+    maintainer :: Maybe (List String)
+    maintainer = case (packageConfigAuthor, packageConfigMaintainer) of
+      (Just _, Nothing) -> packageConfigAuthor
+      (_, Just m) -> m
+      _            -> Nothing
+
 expandForeignSources
   :: MonadIO m
   => FilePath
@@ -1179,8 +1186,14 @@
     expand fieldName xs = do
       expandGlobs fieldName dir (fromMaybeList xs)
 
-expandGlobs :: MonadIO m => String -> FilePath -> [String] -> Warnings m [FilePath]
-expandGlobs name dir patterns = do
+newtype Path = Path { unPath :: FilePath }
+  deriving (Eq, Show, Ord)
+
+instance IsString Path where
+  fromString = Path
+
+expandGlobs :: MonadIO m => String -> FilePath -> [String] -> Warnings m [Path]
+expandGlobs name dir patterns = map Path <$> do
   (warnings, files) <- liftIO $ Util.expandGlobs name dir patterns
   tell warnings
   return files
diff --git a/src/Hpack/Render.hs b/src/Hpack/Render.hs
--- a/src/Hpack/Render.hs
+++ b/src/Hpack/Render.hs
@@ -66,9 +66,9 @@
     packageFields :: [Element]
     packageFields = addVerbatim packageVerbatim . sortFieldsBy existingFieldOrder $
       headerFields ++ [
-        Field "extra-source-files" (LineSeparatedList packageExtraSourceFiles)
-      , Field "extra-doc-files" (LineSeparatedList packageExtraDocFiles)
-      , Field "data-files" (LineSeparatedList packageDataFiles)
+        Field "extra-source-files" (renderPaths packageExtraSourceFiles)
+      , Field "extra-doc-files" (renderPaths packageExtraDocFiles)
+      , Field "data-files" (renderPaths packageDataFiles)
       ] ++ maybe [] (return . Field "data-dir" . Literal) packageDataDir
 
     sourceRepository :: [Element]
@@ -233,9 +233,9 @@
   , renderCxxOptions sectionCxxOptions
   , renderDirectories "include-dirs" sectionIncludeDirs
   , Field "install-includes" (LineSeparatedList sectionInstallIncludes)
-  , Field "c-sources" (LineSeparatedList sectionCSources)
-  , Field "cxx-sources" (LineSeparatedList sectionCxxSources)
-  , Field "js-sources" (LineSeparatedList sectionJsSources)
+  , Field "c-sources" (renderPaths sectionCSources)
+  , Field "cxx-sources" (renderPaths sectionCxxSources)
+  , Field "js-sources" (renderPaths sectionJsSources)
   , renderDirectories "extra-lib-dirs" sectionExtraLibDirs
   , Field "extra-libraries" (LineSeparatedList sectionExtraLibraries)
   , renderDirectories "extra-frameworks-dirs" sectionExtraFrameworksDirs
@@ -395,3 +395,14 @@
 
 renderOtherExtensions :: [String] -> Element
 renderOtherExtensions = Field "other-extensions" . WordList
+
+renderPaths :: [Path] -> Value
+renderPaths = LineSeparatedList . map renderPath
+  where
+    renderPath :: Path -> FilePath
+    renderPath (Path path)
+      | needsQuoting path = show path
+      | otherwise = path
+
+    needsQuoting :: FilePath -> Bool
+    needsQuoting = any (\x -> isSpace x || x == ',')
diff --git a/test/EndToEndSpec.hs b/test/EndToEndSpec.hs
--- a/test/EndToEndSpec.hs
+++ b/test/EndToEndSpec.hs
@@ -832,6 +832,17 @@
           c-sources: foo/*.c
         |] `shouldWarn` pure "Specified pattern \"foo/*.c\" for c-sources does not match any files"
 
+      it "quotes filenames with special characters" $ do
+        touch "cbits/foo bar.c"
+        [i|
+        library:
+          c-sources:
+            - cbits/foo bar.c
+        |] `shouldRenderTo` library_ [i|
+        c-sources:
+            "cbits/foo bar.c"
+        |]
+
     describe "custom-setup" $ do
       it "warns on unknown fields" $ do
         [i|
@@ -1471,6 +1482,30 @@
                 Paths_foo
             default-language: Haskell2010
           |]
+    describe "default value of maintainer" $ do
+      it "gives maintainer precedence" $ do
+        [i|
+          author: John Doe
+          maintainer: Jane Doe
+          |] `shouldRenderTo` package [i|
+          author: John Doe
+          maintainer: Jane Doe
+          |]
+      context "with author" $ do
+        it "uses author if maintainer is not specified" $ do
+          [i|
+            author: John Doe
+            |] `shouldRenderTo` package [i|
+            author: John Doe
+            maintainer: John Doe
+            |]
+        it "omits maintainer if it is null" $ do
+          [i|
+            author: John Doe
+            maintainer: null
+            |] `shouldRenderTo` package [i|
+            author: John Doe
+            |]
 
 run :: HasCallStack => FilePath -> FilePath -> String -> IO ([String], String)
 run userDataDir c old = run_ userDataDir c old >>= either assertFailure return
diff --git a/test/Hpack/ConfigSpec.hs b/test/Hpack/ConfigSpec.hs
--- a/test/Hpack/ConfigSpec.hs
+++ b/test/Hpack/ConfigSpec.hs
@@ -247,7 +247,8 @@
       withPackageConfig_ [i|
         author: John Doe
         |]
-        (`shouldBe` package {packageAuthor = ["John Doe"]})
+        (`shouldBe` package {packageAuthor = ["John Doe"]
+                            ,packageMaintainer = ["John Doe"]})
 
     it "accepts maintainer" $ do
       withPackageConfig_ [i|
