Skip to content

fix #369#380

Merged
sayurin merged 2 commits intoffftp:masterfrom
powneco:master
May 4, 2023
Merged

fix #369#380
sayurin merged 2 commits intoffftp:masterfrom
powneco:master

Conversation

@powneco
Copy link
Copy Markdown
Contributor

@powneco powneco commented Aug 16, 2022

引数のRemoteFile、Oldの最後尾要素にはファイル名が含まれているため、
指定したファイル名のディレクトリが作成されていました。
remove_filename()でファイル名を取り除き、ディレクトリが作成されないように修正しました。

Copy link
Copy Markdown
Member

@sayurin sayurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PRありがとうございます。コードを一部改善してほしいかなと。

ftpproc.cpp Outdated
for (auto oit = Old.begin(), oend = Old.end(); rit != rend && oit != oend && *rit == *oit; ++rit, ++oit)

fs::path RemotePath = RemoteFile;
RemotePath.remove_filename();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto const RemotePath = RemoteFile.parent_path() で済みますか? OldPath の方も。この方法なら、変更を加えないのでconstも付けられますし。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

レビューありがとうございます。コード修正しました。
parent_path()を使用した方がコードがわかりやすいですね。動作も問題ありませんでした。

ftpproc.cpp Outdated
fs::path path;
auto rit = RemoteFile.begin(), rend = RemoteFile.end();
for (auto oit = Old.begin(), oend = Old.end(); rit != rend && oit != oend && *rit == *oit; ++rit, ++oit)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あ、無駄な空行も減らしたいです。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空行を削除しました。

@powneco powneco requested a review from sayurin August 17, 2022 13:46
@sayurin sayurin added this to the v5.8 milestone May 4, 2023
@sayurin sayurin linked an issue May 4, 2023 that may be closed by this pull request
@sayurin sayurin merged commit 3252098 into ffftp:master May 4, 2023
@sayurin sayurin added the bug label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ファイルではなくディレクトリが作成される

2 participants