14 Commits

Author SHA1 Message Date
Xibo.Wang
f6cd85537a Improve support for memory leak detection
When building with the address sanitizer on, free some more resources before
exiting.  (This is unnecessary when not looking for memory leaks.)
* src/patch.c (init_files_to_delete): Add dispose function for freeing
filenames.
2022-12-29 18:15:19 +08:00
Xibo.Wang
e43fc93428 Make the (debug & 2) output more useful
* src/pch.c (another_hunk): In the (debug & 2) output, fix how empty
lines that are not part of the patch context are printed.  Also, add
newlines to lines that are missing them to keep the output readable.
2022-12-29 18:05:24 +08:00
Xibo.Wang
fbf3f4b4d7 maint: avoid warnings from GCC8
backport from https://git.savannah.gnu.org/gitweb/?p=patch.git;a=commit;h=ae81be0

I configured with --enable-gcc-warnings and bleeding-edge gcc
(version 8.0.1 20180406) and hit some warning-escalated-to-errors.
This fixes them:
* src/common.h (FALLTHROUGH): Define.
* src/patch.c (abort_hunk_context): Use FALLTHROUGH macro in place of
a comment.  This avoids a warning from -Wimplicit-fallthrough=.
* src/pch.c (do_ed_script): Add otherwise unnecessary initialization
to avoid warning from -Wmaybe-uninitialized.
(another_hunk): Use FALLTHROUGH macro here, too, twice.

Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn>
2022-12-29 17:05:05 +08:00
Xibo.Wang
77894f3f9d Test suite: fix Korn shell incompatibility
tests/merge: In a Korn shell, shift apparently fails when $# is 0
2022-12-28 18:58:01 +08:00
Xibo.Wang
ad2aa68086 Test suite compatibility fixes
* tests/crlf-handling, tests/git-cleanup, tests/test-lib.sh: Use printf
instead of echo -e / echo -n for compatibility with systems that don't
support these echo options.
* tests/merge: Minor other cleanups.
2022-12-28 18:42:03 +08:00
Xibo.Wang
8b9b312dcd Avoid set_file_attributes sign conversion warnings 2022-12-28 18:17:44 +08:00
fly_fzc
4b59aad3d6 optimize check by running make in parallel 2022-10-19 18:02:27 +08:00
lubing6
3298b107f6 fix memory leak 2020-03-18 15:51:24 +08:00
openeuler-basic
475690985a CVE-2019-13636 2020-02-03 16:29:15 +08:00
openeuler-basic
68f7530d5c delete redundant file 2020-01-09 23:07:33 +08:00
yang_lijin@qq.com
d8cd698c41 init 2019-12-30 12:59:33 +08:00
dogsheng
17f3d0a5e7 Package init 2019-12-25 16:00:49 +08:00
zhuchunyi
9e0f6cde1a update code 2019-11-06 19:45:18 +08:00
overweight
4bc1354d6c Package init 2019-09-30 11:11:23 -04:00