You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2025/04/05 14:34:03 UTC

(couchdb) 02/02: Explicitly handle empty line

This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch otp-28
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 645745a33c489a2729daf7014ba5d7b72b2b622c
Author: Jay Doane <ja...@apache.org>
AuthorDate: Sat Mar 22 11:10:14 2025 -0700

    Explicitly handle empty line
    
    Not sure yet why this is necessary for OTP 28 but not 27, however this
    is the error we get without it:
    ```
    Kernel pid terminated (application_controller) ("{application_start_failure,config,{{shutdown,{failed_to_start_child,config,{{badmatch,[]},[{config,remove_comments,1,[{file,\"src/config.erl\"},{line,515}]},{lists,map_1,2,[{file,\"lists.erl\"},{line,2388}]},{lists,map_1,2,[{file,\"lists.erl\"},{line,2388}]},{lists,map,2,[{file,\"lists.erl\"},{line,2383}]},{config,parse_ini,1,[{file,\"src/config.erl\"},{line,443}]},{config,parse_ini_file,1,[{file,\"src/config.erl\"},{line,438}]},{config [...]
    ```
---
 src/config/src/config.erl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/config/src/config.erl b/src/config/src/config.erl
index bf8358d1d..68c053009 100644
--- a/src/config/src/config.erl
+++ b/src/config/src/config.erl
@@ -506,6 +506,9 @@ expand_dirs_fmap(File) ->
 
 remove_comments(Line) ->
     case trim(Line) of
+        [] ->
+            % Empty line
+            "";
         [$; | _] ->
             % Comment is at the start of line after it's trimmed
             "";