File 0641-ftp-fixes-epath-error-when-nlisting-file.patch of Package erlang

From 50edb20b32ed64b8a17b97254ee243ea11c88343 Mon Sep 17 00:00:00 2001
From: Kiko Fernandez-Reyes <kiko@erlang.org>
Date: Mon, 23 Jan 2023 09:37:45 +0100
Subject: [PATCH 1/3] ftp: fixes epath error when nlisting file

---
 lib/ftp/src/ftp.erl | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/lib/ftp/src/ftp.erl b/lib/ftp/src/ftp.erl
index 4d81c1b11d..cff22946ab 100644
--- a/lib/ftp/src/ftp.erl
+++ b/lib/ftp/src/ftp.erl
@@ -1804,19 +1804,22 @@ handle_ctrl_result({pos_compl, _}, #state{caller = {handle_dir_result, Dir,
             %% %% overhead to be able to give a good return value. Alas not
             %% %% all ftp implementations behave the same and returning
             %% %% an error string is allowed by the FTP RFC.
-            case lists:dropwhile(fun(?CR) -> false;(_) -> true end,
-                                     binary_to_list(Data)) of
-                    L when (L =:= [?CR, ?LF]) orelse (L =:= []) ->
-                        _ = send_ctrl_message(State, mk_cmd("PWD", [])),
-                        activate_ctrl_connection(State),
-                        {noreply,
-                         State#state{caller = {handle_dir_data, Dir, Data}}};
-                    _ ->
-                        gen_server:reply(From, {ok, Data}),
-                        {noreply, State#state{client = undefined,
-                                              caller = undefined}}
-            end
+            %% case lists:dropwhile(fun(?CR) -> false;(_) -> true end,
+            %%                          binary_to_list(Data)) of
+            %%         L when (L =:= [?CR, ?LF]) orelse (L =:= []) ->
+            %%             _ = send_ctrl_message(State, mk_cmd("PWD", [])),
+            %%             activate_ctrl_connection(State),
+            %%             {noreply,
+            %%              State#state{caller = {handle_dir_data, Dir, Data}}};
+            %%         _ ->
+            %%             gen_server:reply(From, {ok, Data}),
+            %%             {noreply, State#state{client = undefined,
+            %%                                   caller = undefined}}
+            %% end
             %% </WTF>
+            gen_server:reply(From, {ok, Data}),
+            {noreply, State#state{client = undefined,
+                                  caller = undefined}}
     end;
 
 handle_ctrl_result({pos_compl, _}=Operation, #state{caller = {handle_dir_result, Dir},
-- 
2.35.3

openSUSE Build Service is sponsored by