File 0001-Prevent-wrong-log-location.patch of Package lager

From ccb3c109722c6deafc08bc5dcc89ce570ad9e5a9 Mon Sep 17 00:00:00 2001
From: "Paulo F. Oliveira" <paulo.ferraz.oliveira@gmail.com>
Date: Tue, 9 Feb 2021 00:20:41 +0000
Subject: [PATCH] Prevent "wrong" log location

---
 src/lager_util.erl | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/lager_util.erl b/src/lager_util.erl
index 4f0c6ff..6dd0972 100644
--- a/src/lager_util.erl
+++ b/src/lager_util.erl
@@ -464,11 +464,11 @@ expand_path(RelPath) ->
                    {ok, LogRoot} when is_list(LogRoot) -> % Join relative path
                        %% check if the given RelPath contains LogRoot, if so, do not add
                        %% it again; see gh #304
-                       case string:str(filename:dirname(RelPath), LogRoot) of
-                           X when X > 0 ->
-                               RelPath;
-                           _Zero ->
-                               filename:join(LogRoot, RelPath)
+                       case filename:dirname(RelPath) of
+                           "." ->
+                               filename:join(LogRoot, RelPath);
+                           false ->
+                               RelPath
                        end;
                    undefined -> % No log_root given, keep relative path
                        RelPath
-- 
2.26.2

openSUSE Build Service is sponsored by