Skip to content

Commit 6072416

Browse files
committed
Commit 154
- A bug has been fixed in `load_ini_path()` (`fclose()` was not invoked in case of errors) - Code review (`strip_ini_cache()`, `load_ini_file()`, `load_ini_path()`; private function `further_cuts()`) - Documentation - Examples
1 parent a1969a4 commit 6072416

37 files changed

+247
-189
lines changed

ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ Change Log
22
==========
33

44

5+
## 1.16.4 (2022-07-21)
6+
7+
Changes:
8+
9+
* A bug has been fixed in `load_ini_path()` (`fclose()` was not invoked in case of
10+
errors)
11+
* Code review (`strip_ini_cache()`, `load_ini_file()`, `load_ini_path()`; private
12+
function `further_cuts()`)
13+
* Documentation
14+
* Examples
15+
16+
517
## 1.16.3 (2021-11-09)
618

719
Changes:

INSTALL

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ information about how to proceed, please see `dev/hackings/baremetal/README.md`.
161161
Comparison of different compilers
162162
---------------------------------
163163

164-
In all the tests GCC always produced the fastest binary. Clang produced a code
165-
about 10% slower (with both `-O2` and `-O3`), whereas Microsoft Visual Studio
166-
lied far behind.
164+
In all the tests so far GCC always produced the fastest binary. Clang produced
165+
a binary about 10% slower (with both `-O2` and `-O3`), whereas Microsoft Visual
166+
Studio lay far behind.
167167

168168

169169
Complex installations

MANUAL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,14 +566,16 @@ int load_ini_buffer (
566566
void * const user_data
567567
) {
568568
569-
char * const ini_cache = strndup(ini_buffer, ini_length);
569+
char * const ini_cache = malloc(ini_length);
570570
571571
if (!ini_cache) {
572572
573573
return CONFINI_ENOMEM;
574574
575575
}
576576
577+
memcpy(ini_cache, ini_buffer, ini_length);
578+
577579
const int retval = strip_ini_cache(
578580
ini_cache,
579581
ini_length,

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ News
22
====
33

44

5+
## 1.16.4
6+
7+
* A bug has been fixed in `load_ini_path()` (`fclose()` was not invoked in case of
8+
errors)
9+
10+
511
## 1.16.2
612

713
* Issue [#16](https://github.com/madmurphy/libconfini/issues/16) has been fixed

autostuff/m4/not-autotools.m4

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,11 @@ dnl Requires: `NA_SANITIZE_VARNAME()` and `NA_ESC_APOS()`
539539
dnl From: not-autotools/m4/not-autotools.m4
540540
dnl
541541
AC_DEFUN([NC_GLOBAL_LITERALS],
542-
[m4_pushdef([_lit_], m4_quote(NA_SANITIZE_VARNAME([$1])))[]m4_define([GL_]_lit_,
543-
m4_normalize([$2]))
544-
AC_SUBST(_lit_, ['NA_ESC_APOS(m4_normalize([$2]))'])[]m4_popdef([_lit_])[]m4_if(m4_eval([$# > 2]), [1],
545-
[NC_GLOBAL_LITERALS(m4_shift2($@))])])
542+
[m4_if([$#], [0], [], [$#], [1], [],
543+
[m4_pushdef([_lit_], m4_quote(NA_SANITIZE_VARNAME([$1])))[]m4_define([GL_]m4_quote(_lit_),
544+
m4_normalize([$2]))[]m4_newline()[]AC_SUBST(_lit_,
545+
[']NA_ESC_APOS(m4_normalize([$2]))['])[]m4_popdef([_lit_])[]m4_if([$#], [2], [],
546+
[NC_GLOBAL_LITERALS(m4_shift2($@))])])])
546547
547548
548549
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
22

3-
@file confini.c
4-
@brief libconfini functions
5-
@author Stefano Gioffré
6-
@copyright @LICENSE_STRING@
7-
@version @PACKAGE_VERSION@
8-
@date 2016-2021
9-
@see @PACKAGE_URL@
3+
@file confini.c
4+
@brief libconfini functions
5+
@author Stefano Gioffré
6+
@copyright @LICENSE_STRING@
7+
@version @PACKAGE_VERSION@
8+
@date @PROJECT_YEARS@
9+
@see @PACKAGE_URL@
1010

1111
**/

autostuff/shadows/dev/hackings/all/confini-metadata.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@author Stefano Gioffré
66
@copyright @LICENSE_STRING@
77
@version @PACKAGE_VERSION@
8-
@date 2016-2021
8+
@date @PROJECT_YEARS@
99
@see @PACKAGE_URL@
1010
1111
**/

configure.ac

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,23 @@ AC_INIT([lib]n4_mem([GL_PROJECT_NAME], [confini]),
2929
m4_joinall([.],
3030
n4_mem([GL_PROJECT_MAJVER], [1]),
3131
n4_mem([GL_PROJECT_MINVER], [16]),
32-
n4_mem([GL_PROJECT_REVVER], [3])),
32+
n4_mem([GL_PROJECT_REVVER], [4])),
3333
3434
[lib]GL_PROJECT_NAME,
3535
[https://madmurphy.github.io/libconfini])
3636

3737
NC_GLOBAL_LITERALS(
3838
[INTERFACE_NUM], [5],
3939
[INTERFACES_SUPPORTED], [5],
40-
[IMPLEMENTATION_NUM], [2],
40+
[IMPLEMENTATION_NUM], [3],
4141
[PROJECT_DESCRIPTION], [Yet another INI parser],
4242
[LICENSE_STRING], [GNU General Public License, version 3 or any
4343
later version],
4444
[LICENSE_SPDX], [GPL-3.0-or-later],
4545
[PUBLISHER_NAME], [Stefano Gioffré],
4646
[PUBLISHER_ID], [madmurphy],
47-
[GIT_HTTP_SERVER], [https://github.com]
47+
[GIT_HTTP_SERVER], [https://github.com],
48+
[PROJECT_YEARS], [2016-2022]
4849
)
4950

5051

dev/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ inside loops creates slow code, and if these conditions are not going to change
5555
during the loop, unacceptable code -- for instance, it does not make much sense
5656
to check for every character whether a format supports quotes or not, this is
5757
something that will remain constant during the entire parsing. The normal
58-
solution would be keeping the constant conditions outside the loops and
58+
solution would be that of keeping the constant conditions outside the loops and
5959
creating slightly different loops for each case, but this is unthinkable with
6060
110592 possibilities. There is however also a third way: bit masks. Bit masks
6161
allow to collapse several conditions into one single operation and keep the
@@ -91,9 +91,9 @@ two, but dozens each time. And while bit masks do keep the number of branches
9191
constant, they definitely look esoteric.
9292

9393
The usual way to avoid esoteric code is that of using `enum` labels for
94-
bitflags. In **libconfini**'s case however this would not help much, bitflags
95-
are used so often that it would just fill the entire source code of `enum`s.
96-
The esoterism would just change form.
94+
bitflags. With **libconfini** however this would not help much: bitflags are
95+
used so often that it would just fill the entire source code of `enum`s. The
96+
esoterism would just change form.
9797

9898
I am sorry if the code scares you, but there are no other ways, I am afraid.¹
9999
If you want to understand how the library works you will have to get used to
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
22
3-
@file confini.c
4-
@brief libconfini functions
5-
@author Stefano Gioffré
6-
@copyright GNU General Public License, version 3 or any later version
7-
@version 1.16.3
8-
@date 2016-2021
9-
@see https://madmurphy.github.io/libconfini
3+
@file confini.c
4+
@brief libconfini functions
5+
@author Stefano Gioffré
6+
@copyright GNU General Public License, version 3 or any later version
7+
@version 1.16.4
8+
@date 2016-2022
9+
@see https://madmurphy.github.io/libconfini
1010
1111
**/

0 commit comments

Comments
 (0)