Skip to content

Commit 4bef811

Browse files
committed
Merge branch 'release/v4.2.6'
2 parents 19e0ad6 + aa89e58 commit 4bef811

File tree

8 files changed

+40
-9
lines changed

8 files changed

+40
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@
1414
# CMake build directories
1515
build*/
1616
html/
17+
# ingore temporary vim files
18+
*.swp

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ project(
55
DESCRIPTION "C library for parsing INI-style files"
66
HOMEPAGE_URL https://gitlab.com/iniparser/iniparser/
77
LANGUAGES C
8-
VERSION 4.2.5)
8+
VERSION 4.2.6)
99

1010
include(GNUInstallDirs)
1111
include(CMakePackageConfigHelpers)
@@ -207,6 +207,8 @@ if(BUILD_DOCS)
207207
doxygen_add_docs(
208208
docs
209209
${CMAKE_CURRENT_SOURCE_DIR}/README.md
210+
${CMAKE_CURRENT_SOURCE_DIR}/FAQ-en.md
211+
${CMAKE_CURRENT_SOURCE_DIR}/FAQ-zhcn.md
210212
${CMAKE_CURRENT_SOURCE_DIR}/src/iniparser.h
211213
ALL)
212214
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Go there for:
1111
- [Merge Requests](https://gitlab.com/iniparser/iniparser/-/merge_requests/new)
1212

1313
Changes in March 2024:
14-
@lmoellendorf took over maintenance for this project.
14+
\@lmoellendorf took over maintenance for this project.
1515

1616
- [X] The objective was to get all known issues fixed and released as v4.2.
1717
- [X] After that, this project has been frozen on Github as v4.2.1 and
@@ -21,7 +21,7 @@ Changes in March 2024:
2121
Thanks a million times to Lars for his tremendous work and help in keeping this
2222
library alive!
2323

24-
Many thanks to @touilleman for his exceptional contributions and efforts for
24+
Many thanks to \@touilleman for his exceptional contributions and efforts for
2525
maintaining this project for a decade. Manu, you rock!
2626

2727
## Overview
@@ -35,6 +35,12 @@ Key features:
3535
- Fully re-entrant : easy to make it thread-safe (just surround
3636
library calls by mutex)
3737

38+
## Installation
39+
40+
iniParser is available in a number of package repositories:
41+
42+
[![Packaging status](https://repology.org/badge/vertical-allrepos/iniparser.svg)](https://repology.org/project/iniparser/versions)
43+
3844
## MinGW
3945

4046
In the instructions below, replace `make all` by `ninja` if you are using
@@ -139,7 +145,7 @@ make all
139145
Open the file `html/index.html` with any HTML-capable browser.
140146

141147
Or see the [complete documentation](https://iniparser.gitlab.io/iniparser/)
142-
in online.
148+
online.
143149

144150

145151
## License
@@ -282,7 +288,7 @@ the section name, and a NULL associated value. They can be queried through
282288
`iniparser_find_entry()`.
283289

284290
To launch the parser, use the function called `iniparser_load()`, which takes
285-
an input file name and returns a newly allocated @e dictionary structure. This
291+
an input file name and returns a newly allocated `dictionary` structure. This
286292
latter object should remain opaque to the user and only accessed through the
287293
following accessor functions:
288294

compile_commands.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/compile_commands.json

src/iniparser.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,9 @@ void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f)
325325
int seclen ;
326326
char escaped[(ASCIILINESZ * 2) + 2] = "";
327327

328-
if (d==NULL || f==NULL) return ;
329-
if (! iniparser_find_entry(d, s)) return ;
328+
if (d==NULL || f==NULL) return;
329+
if (! iniparser_find_entry(d, s)) return;
330+
if (strlen(s) > sizeof(keym)) return;
330331

331332
seclen = (int)strlen(s);
332333
fprintf(f, "\n[%s]\n", s);

test/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ FetchContent_Declare(
3434
${CMAKE_CURRENT_LIST_DIR}/unity_config.h ./src/)
3535

3636
FetchContent_MakeAvailable(unity)
37-
target_compile_definitions(unity PUBLIC UNITY_INCLUDE_CONFIG_H)
37+
target_compile_definitions(unity PUBLIC UNITY_INCLUDE_CONFIG_H
38+
UNITY_USE_COMMAND_LINE_ARGS)
3839

3940
function(create_test_runner)
4041
set(options)
@@ -53,7 +54,7 @@ function(create_test_runner)
5354
COMMAND
5455
${RUBY_EXECUTABLE} ${unity_SOURCE_DIR}/auto/generate_test_runner.rb
5556
${CMAKE_CURRENT_SOURCE_DIR}/test_${TEST_RUNNER_NAME}.c
56-
test_${TEST_RUNNER_NAME}_runner.c
57+
test_${TEST_RUNNER_NAME}_runner.c ${CMAKE_CURRENT_LIST_DIR}/unity-config.yml
5758
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/test_${TEST_RUNNER_NAME}.c
5859
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
5960

test/test_iniparser.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,8 @@ void test_iniparser_dump_ini(void)
10421042
void test_iniparser_dumpsection_ini(void)
10431043
{
10441044
const char *str;
1045+
char key[4096] = {};
1046+
int ret;
10451047

10461048
/*loading old.ini*/
10471049
dic = iniparser_load(OLD_INI_PATH);
@@ -1070,6 +1072,20 @@ void test_iniparser_dumpsection_ini(void)
10701072
TEST_ASSERT_EQUAL_STRING("321abc", str);
10711073
iniparser_freedict(dic);
10721074
dic = NULL;
1075+
/*test extra large keys*/
1076+
dic = dictionary_new(0);
1077+
TEST_ASSERT_NOT_NULL(dic);
1078+
memset(key, 'a', sizeof(key)-1);
1079+
ret = iniparser_set(dic, key, "dummy");
1080+
TEST_ASSERT_GREATER_OR_EQUAL(0, ret);
1081+
ini = fopen(TMP_INI_PATH, "wt");
1082+
TEST_ASSERT_NOT_NULL_MESSAGE(ini, "cannot open " TMP_INI_PATH);
1083+
/*dump the data of old.ini to test.ini*/
1084+
iniparser_dumpsection_ini(dic,key,ini);
1085+
fclose(ini);
1086+
ini = NULL;
1087+
iniparser_freedict(dic);
1088+
dic = NULL;
10731089
}
10741090

10751091
void test_iniparser_find_entry(void)

test/unity-config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:unity:
2+
:cmdline_args: 1

0 commit comments

Comments
 (0)