Skip to content

Commit

Permalink
Aligning error message with used version
Browse files Browse the repository at this point in the history
  • Loading branch information
Niclas Eklund authored and Erlang/OTP committed May 26, 2010
1 parent 949935c commit 64943ba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/ssh/src/ssh_sftpd.erl
Expand Up @@ -242,18 +242,23 @@ handle_op(?SSH_FXP_REALPATH, ReqId,
end;
handle_op(?SSH_FXP_OPENDIR, ReqId,
<<?UINT32(RLen), RPath:RLen/binary>>,
State0 = #state{file_handler = FileMod, file_state = FS0}) ->
State0 = #state{xf = #ssh_xfer{vsn = Vsn},
file_handler = FileMod, file_state = FS0}) ->
RelPath = binary_to_list(RPath),
AbsPath = relate_file_name(RelPath, State0),

XF = State0#state.xf,
{IsDir, FS1} = FileMod:is_dir(AbsPath, FS0),
State1 = State0#state{file_state = FS1},
case IsDir of
false ->
false when Vsn > 5 ->
ssh_xfer:xf_send_status(XF, ReqId, ?SSH_FX_NOT_A_DIRECTORY,
"Not a directory"),
State1;
false ->
ssh_xfer:xf_send_status(XF, ReqId, ?SSH_FX_FAILURE,
"Not a directory"),
State1;
true ->
add_handle(State1, XF, ReqId, directory, {RelPath,unread})
end;
Expand Down

0 comments on commit 64943ba

Please sign in to comment.