This is an automated email from the ASF dual-hosted git repository.
ronny pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/main by this push:
new 5c5016e7d Fix unbound variable warning (#4289)
5c5016e7d is described below
commit 5c5016e7d24b986d44f01f7bf4d0c0f3550324c5
Author: Ronny Berndt <[email protected]>
AuthorDate: Mon Dec 5 16:54:11 2022 +0100
Fix unbound variable warning (#4289)
While the variable `RelativeFileName` is not really unbound in the
case-statement, use a
more up-to-date pattern for binding the value.
---
src/couch/src/couch_server.erl | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl
index 9e5ab87d8..4af4c1ff4 100644
--- a/src/couch/src/couch_server.erl
+++ b/src/couch/src/couch_server.erl
@@ -416,10 +416,11 @@ all_databases(Fun, Acc0) ->
true,
fun(Filename, AccIn) ->
NormFilename = couch_util:normpath(Filename),
- case NormFilename -- NormRoot of
- [$/ | RelativeFilename] -> ok;
- RelativeFilename -> ok
- end,
+ RelativeFilename =
+ case NormFilename -- NormRoot of
+ [$/ | FName] -> FName;
+ FName -> FName
+ end,
Ext = filename:extension(RelativeFilename),
case Fun(?l2b(filename:rootname(RelativeFilename, Ext)),
AccIn) of
{ok, NewAcc} -> NewAcc;