Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ea8412b

Browse files
committed
fix ssu_rsync remove swp bug
1 parent b37b222 commit ea8412b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎ssu_rsync.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
157157
exit(1);
158158
}
159159

160-
strncpy(swap_path, dst_path, strlen(dst_path) - strlen(get_file_name(dst_path)));
160+
strncpy(swap_path, dst_path, get_file_name(dst_path) - dst_path);
161161
#ifdef DEBUG
162162
printf("ssu_rsync(): cd %s\n", swap_path);
163163
#endif
@@ -172,7 +172,11 @@ int main(int argc, char *argv[])
172172
chdir(pwd); // 실행 경로로 복귀
173173
signal(SIGINT, recovery); // SIGINT 시그널 처리
174174
syncronize(src_path, dst_path); // 동기화
175-
remove(swap_path); // swap 파일 삭제
175+
sprintf(swap_path, "%s.swp", dst_path);
176+
#ifdef DEBUG
177+
printf("ssu_rsync(): swap_path = %s\n", swap_path);
178+
#endif
179+
unlink(swap_path); // swap 파일 삭제
176180

177181
gettimeofday(&end_t, NULL); // 측정 종료
178182
ssu_runtime(&begin_t, &end_t); // 실행 시간 출력

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /