Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libeconf for openSUSE:Factory checked in at 2026-10-16 20:06:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libeconf (Old) and /work/SRC/openSUSE:Factory/.libeconf.new.3698736 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libeconf" Fri Oct 16 20:06:33 2026 rev:43 rq:1385021 version:0.8.6 Changes: -------- --- /work/SRC/openSUSE:Factory/libeconf/libeconf.changes 2026-10-10 14:55:18.288754193 +0200 +++ /work/SRC/openSUSE:Factory/.libeconf.new.3698736/libeconf.changes 2026-10-16 20:06:35.395372687 +0200 @@ -1,0 +2,7 @@ +Thu Oct 15 12:44:55 UTC 2026 - [email protected] + +- Update to version 0.8.6: + * Add new option DEFAULT_QUOTES for econf_newKeyFile_with_options. + * NEW API calls: econf_hasQuotes, econf_setQuotes + +------------------------------------------------------------------- python-libeconf.changes: same change Old: ---- libeconf-0.8.5.tar.xz New: ---- libeconf-0.8.6.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libeconf.spec ++++++ --- /var/tmp/diff_new_pack.0KD8QY/_old 2026-10-16 20:06:37.983480757 +0200 +++ /var/tmp/diff_new_pack.0KD8QY/_new 2026-10-16 20:06:37.996481299 +0200 @@ -18,7 +18,7 @@ %define lname libeconf0 Name: libeconf -Version: 0.8.5 +Version: 0.8.6 Release: 0 Summary: Enhanced config file parser ala systemd License: MIT ++++++ python-libeconf.spec ++++++ --- /var/tmp/diff_new_pack.0KD8QY/_old 2026-10-16 20:06:38.080484807 +0200 +++ /var/tmp/diff_new_pack.0KD8QY/_new 2026-10-16 20:06:38.082484891 +0200 @@ -19,7 +19,7 @@ %{?sle15_python_module_pythons} %define skip_python39 1 Name: python-libeconf -Version: 0.8.5 +Version: 0.8.6 Release: 0 Summary: Python bindings for libeconf License: MIT ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.0KD8QY/_old 2026-10-16 20:06:38.285493368 +0200 +++ /var/tmp/diff_new_pack.0KD8QY/_new 2026-10-16 20:06:38.294493743 +0200 @@ -1,7 +1,7 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/openSUSE/libeconf.git</param> - <param name="changesrevision">24a835b40ef1421489ff35fc93e44ec8d82f0389</param> + <param name="changesrevision">9f43b3480209272e4f4992129cca7a40b3e496e9</param> </service> </servicedata> (No newline at EOF) ++++++ libeconf-0.8.5.tar.xz -> libeconf-0.8.6.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/CMakeLists.txt new/libeconf-0.8.6/CMakeLists.txt --- old/libeconf-0.8.5/CMakeLists.txt 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/CMakeLists.txt 2026-10-15 14:25:03.000000000 +0200 @@ -3,7 +3,7 @@ # Ensure built-in policies from CMake are used, (e.g. improved policies for macOS) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) -project(libeconf VERSION 0.8.5 +project(libeconf VERSION 0.8.6 DESCRIPTION "Enhanced config file parser, which merges config files placed in several locations into one." LANGUAGES C ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/NEWS new/libeconf-0.8.6/NEWS --- old/libeconf-0.8.5/NEWS 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/NEWS 2026-10-15 14:25:03.000000000 +0200 @@ -1,3 +1,7 @@ +Version 0.8.6 +* Add new option DEFAULT_QUOTES for econf_newKeyFile_with_options. +* NEW API calls: econf_hasQuotes, econf_setQuotes + Version 0.8.5 * Fix a crash if sections are empty. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/doc/CMakeLists.txt new/libeconf-0.8.6/doc/CMakeLists.txt --- old/libeconf-0.8.5/doc/CMakeLists.txt 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/doc/CMakeLists.txt 2026-10-15 14:25:03.000000000 +0200 @@ -51,9 +51,11 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_getUIntValueDef.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_getValue.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_getValueDef.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_hasQuotes.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_mergeFiles.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_newIniFile.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_newKeyFile.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_newKeyFile_with_options.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_readConfig.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_readConfigWithCallback.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_readFile.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) @@ -67,6 +69,7 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_setFloatValue.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_setInt64Value.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_setIntValue.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_setQuotes.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_setStringValue.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_setUInt64Value.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econf_setValue.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/doc/man/econf_hasQuotes.3 new/libeconf-0.8.6/doc/man/econf_hasQuotes.3 --- old/libeconf-0.8.5/doc/man/econf_hasQuotes.3 1970-01-01 01:00:00.000000000 +0100 +++ new/libeconf-0.8.6/doc/man/econf_hasQuotes.3 2026-10-15 14:25:03.000000000 +0200 @@ -0,0 +1,78 @@ +'\" t +.\" Title: ECONF_HASQUOTES +.\" Author: libeconf developers +.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> +.\" Date: 2026-10-15 +.\" Manual: libeconf Manual +.\" Source: libeconf +.\" Language: English +.\" +.TH "ECONF_HASQUOTES" "3" "2026\-10\-15" "libeconf" "libeconf Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- + +.SH "NAME" +econf_hasQuotes \- check whether the value of a key is enclosed by quotes + +.SH "SYNOPSIS" + +.sp +.ft B +.nf +#include <libeconf\&.h> +.fi +.ft +.sp + +.BI "bool econf_hasQuotes(econf_file\ *" "kf" ", const\ char\ *" "group" ", const\ char\ *" "key" ");" + +.SH "DESCRIPTION" + +.PP +The \fBeconf_hasQuotes\fR() function checks whether the value of the key specified by \fIgroup\fR and \fIkey\fR in the given configuration file object \fIkf\fR is enclosed by quotes\&. If \fIgroup\fR is \fBNULL\fR, the key is considered to belong to no group\&. + +.PP +A value is enclosed by quotes either because it was parsed from a configuration file where it was written with a leading quote character, or because it was marked as such with \fBeconf_setQuotes\fR()\&. This flag only affects how the value will be enclosed by quotes when the configuration is written back with \fBeconf_writeFile\fR()\&. + +.SH "RETURN VALUE" + +.PP +\fBeconf_hasQuotes\fR() +returns +\fBtrue\fR +if the value of the given \fIgroup\fR/\fIkey\fR is enclosed by quotes, and +\fBfalse\fR +otherwise\&. + +.PP +\fBfalse\fR +is also returned if +\fIkf\fR +is +\fBNULL\fR, or if the +\fIgroup\fR/\fIkey\fR +combination has not been found\&. + +.SH "SEE ALSO" + +.PP +\fBlibeconf\fR(3), +\fBeconf_setQuotes\fR(3), +\fBeconf_writeFile\fR(3)\& diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/doc/man/econf_newKeyFile.3 new/libeconf-0.8.6/doc/man/econf_newKeyFile.3 --- old/libeconf-0.8.5/doc/man/econf_newKeyFile.3 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/doc/man/econf_newKeyFile.3 2026-10-15 14:25:03.000000000 +0200 @@ -84,6 +84,7 @@ .PP \fBlibeconf\fR(3), \fBeconf_newIniFile\fR(3), +\fBeconf_newKeyFile_with_options\fR(3), \fBeconf_freeFile\fR(3), \fBeconf_errString\fR(3)\&. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/doc/man/econf_newKeyFile_with_options.3 new/libeconf-0.8.6/doc/man/econf_newKeyFile_with_options.3 --- old/libeconf-0.8.5/doc/man/econf_newKeyFile_with_options.3 1970-01-01 01:00:00.000000000 +0100 +++ new/libeconf-0.8.6/doc/man/econf_newKeyFile_with_options.3 2026-10-15 14:25:03.000000000 +0200 @@ -0,0 +1,167 @@ +'\" t +.\" Title: ECONF_NEWKEYFILE_WITH_OPTIONS +.\" Author: libeconf developers +.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> +.\" Date: 2026-10-15 +.\" Manual: libeconf Manual +.\" Source: libeconf +.\" Language: English +.\" +.TH "ECONF_NEWKEYFILE_WITH_OPTIONS" "3" "2026\-10\-15" "libeconf" "libeconf Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- + +.SH "NAME" +econf_newKeyFile_with_options \- create a new econf_file object with special options + +.SH "SYNOPSIS" + +.sp +.ft B +.nf +#include <libeconf\&.h> +.fi +.ft +.sp + +.BI "econf_err econf_newKeyFile_with_options(econf_file\ **" "result" ", const\ char\ *" "options" ");" + +.SH "DESCRIPTION" + +.PP +The \fBeconf_newKeyFile_with_options\fR() function creates a new, empty \fBeconf_file\fR object and stores it in \fI*result\fR\&. + +.PP +\fIoptions\fR is a string of \fB<key>=<value>\fR pairs separated by \*(Aq;\*(Aq, e\&.g\&. \fB"JOIN_SAME_ENTRIES=1"\fR\&. If \fIoptions\fR is \fBNULL\fR or an empty string, the new \fBeconf_file\fR object is created with the default settings described below\&. + +.PP +The following options are supported: + +.PP +\fBJOIN_SAME_ENTRIES\fR (default 0) +.RS 4 + Parsed entries with the same name will not be replaced but will be joined to one entry\&. + +.RE + +.PP +\fBPYTHON_STYLE\fR (default 0) +.RS 4 + Indentations will be handled like multiline entries\&. + +.RE + +.PP +\fBDEFAULT_QUOTES\fR (default 0) +.RS 4 + Entries which are newly created (e\&.g\&. via \fBeconf_setStringValue\fR()) and not read from a file will have their value enclosed by quotes when the \fBeconf_file\fR is written to a file\&. This default can be overridden per entry with \fBeconf_setQuotes\fR()\&. + +.RE + +.PP +\fBPARSING_DIRS\fR (default /usr/etc/:/run:/etc) +.RS 4 + List of directories from which the configuration files have to be parsed\&. The list is a string, divided by \*(Aq:\*(Aq\&. The last entry has the highest priority\&. E\&.g\&.: \fB"PARSING_DIRS=/usr/etc/:/run:/etc"\fR\&. + +.RE + +.PP +\fBCONFIG_DIRS\fR (default empty) +.RS 4 + List of directory structures (with order) which describes the directories in which the files have to be parsed\&. The list is a string, divided by \*(Aq:\*(Aq\&. The last entry has the highest priority\&. E\&.g\&. with the given list \fB"CONFIG_DIRS=.conf.d:.d"\fR +files in the following directories will be parsed: +.sp +.RS 4 +<default_dirs>/<config_name>\&.conf\&.d/ +.br +<default_dirs>/<config_name>\&.d/ +.br +<default_dirs>/<config_name>/ +.RE + +.RE + +.PP +\fBROOT_PREFIX\fR (default empty) +.RS 4 + Directory prefix used for all search directories if specified\&. + +.RE + +.SH "RETURN VALUE" + +.PP +Upon successful completion, this function returns \fBECONF_SUCCESS\fR and stores the newly created \fBeconf_file\fR object in \fI*result\fR\&. + +.PP +On error, a non\-zero error code is returned (see the section called \(lqERRORS\(rq), and \fI*result\fR may be set to \fBNULL\fR\&. + +.SH "ERRORS" + +.PP +\fBECONF_NOMEM\fR +.RS 4 + Insufficient memory to allocate the new \fBeconf_file\fR object or one of its internal lists\&. + +.RE + +.PP +\fBECONF_OPTION_NOT_FOUND\fR +.RS 4 + \fIoptions\fR contains a key that is not a known option\&. + +.RE + +.SH "EXAMPLES" + +.PP +.nf +#include <libeconf\&.h> + +econf_file *key_file = NULL; +econf_err error; + +if ((error = econf_newKeyFile_with_options(&key_file, "PYTHON_STYLE=1"))) +{ + fprintf (stderr, "ERROR: couldn\*(Aqt create new key file: %s\en", + econf_errString(error)); + return 1; +} + +error = econf_readConfig (&key_file, + "foo", + "/usr/lib", + "example", + "conf", + "=", "#"); + +econf_free (key_file); +key_file = NULL; +.fi + +.SH "SEE ALSO" + +.PP +\fBlibeconf\fR(3), +\fBeconf_newKeyFile\fR(3), +\fBeconf_newIniFile\fR(3), +\fBeconf_setQuotes\fR(3), +\fBeconf_freeFile\fR(3), +\fBeconf_errString\fR(3)\& diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/doc/man/econf_setQuotes.3 new/libeconf-0.8.6/doc/man/econf_setQuotes.3 --- old/libeconf-0.8.5/doc/man/econf_setQuotes.3 1970-01-01 01:00:00.000000000 +0100 +++ new/libeconf-0.8.6/doc/man/econf_setQuotes.3 2026-10-15 14:25:03.000000000 +0200 @@ -0,0 +1,98 @@ +'\" t +.\" Title: ECONF_SETQUOTES +.\" Author: libeconf developers +.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> +.\" Date: 2026-10-15 +.\" Manual: libeconf Manual +.\" Source: libeconf +.\" Language: English +.\" +.TH "ECONF_SETQUOTES" "3" "2026\-10\-15" "libeconf" "libeconf Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- + +.SH "NAME" +econf_setQuotes \- set whether the value of a key has to be enclosed by quotes + +.SH "SYNOPSIS" + +.sp +.ft B +.nf +#include <libeconf\&.h> +.fi +.ft +.sp + +.BI "econf_err econf_setQuotes(econf_file\ *" "kf" ", const\ char\ *" "group" ", const\ char\ *" "key" ", const\ bool\ " "quotes" ");" + +.SH "DESCRIPTION" + +.PP +The \fBeconf_setQuotes\fR() function sets whether the value of the key specified by \fIgroup\fR and \fIkey\fR in the given configuration file object \fIkf\fR has to be enclosed by quotes when the configuration is written back with \fBeconf_writeFile\fR()\&. If \fIgroup\fR is \fBNULL\fR, the key is considered to belong to no group\&. + +.PP +If \fIquotes\fR is \fBtrue\fR, the value will be written enclosed by double quotes\&. If \fIquotes\fR is \fBfalse\fR, the value will be written without quotes\&. + +.PP +Unlike the \fBeconf_set*Value\fR() functions, \fBeconf_setQuotes\fR() does not create the key if the \fIgroup\fR/\fIkey\fR combination does not already exist\&. + +.PP +The default value of the quotes flag for newly created entries (entries not read from a configuration file) can be changed from \fBfalse\fR to \fBtrue\fR with the \fBDEFAULT_QUOTES\fR option of \fBeconf_newKeyFile_with_options\fR()\&. + +.SH "RETURN VALUE" + +.PP +Upon successful completion, this function returns \fBECONF_SUCCESS\fR\&. + +.PP +On error, a non\-zero error code is returned (see the section called \(lqERRORS\(rq)\&. + +.SH "ERRORS" + +.PP +\fBECONF_FILE_LIST_IS_NULL\fR +.RS 4 + Conf file list is NULL\&. + +.RE + +.PP +\fBECONF_EMPTYKEY\fR +.RS 4 + Key is NULL or has empty value\&. + +.RE + +.PP +\fBECONF_NOKEY\fR +.RS 4 + Key not found\&. + +.RE + +.SH "SEE ALSO" + +.PP +\fBlibeconf\fR(3), +\fBeconf_hasQuotes\fR(3), +\fBeconf_setValue\fR(3), +\fBeconf_writeFile\fR(3), +\fBeconf_errString\fR(3)\& diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/doc/meson.build new/libeconf-0.8.6/doc/meson.build --- old/libeconf-0.8.5/doc/meson.build 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/doc/meson.build 2026-10-15 14:25:03.000000000 +0200 @@ -52,9 +52,11 @@ 'man/econf_getUIntValueDef.3', 'man/econf_getValue.3', 'man/econf_getValueDef.3', + 'man/econf_hasQuotes.3', 'man/econf_mergeFiles.3', 'man/econf_newIniFile.3', 'man/econf_newKeyFile.3', + 'man/econf_newKeyFile_with_options.3', 'man/econf_readConfig.3', 'man/econf_readConfigWithCallback.3', 'man/econf_readFile.3', @@ -68,6 +70,7 @@ 'man/econf_setFloatValue.3', 'man/econf_setInt64Value.3', 'man/econf_setIntValue.3', + 'man/econf_setQuotes.3', 'man/econf_setStringValue.3', 'man/econf_setUInt64Value.3', 'man/econf_setValue.3', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/include/libeconf.h new/libeconf-0.8.6/include/libeconf.h --- old/libeconf-0.8.5/include/libeconf.h 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/include/libeconf.h 2026-10-15 14:25:03.000000000 +0200 @@ -643,6 +643,10 @@ * will be joined to one entry. * PYTHON_STYLE (default 0) * E.G. Identations will be handled like multiline entries. + * DEFAULT_QUOTES (default 0) + * Entries which are newly created (e.g. via econf_setStringValue) and not + * read from a file will have their value enclosed by quotes when the + * econf_file is written to a file. * PARSING_DIRS (default /usr/etc/:/run:/etc) * List of directories from which the configuration files have to be parsed. * The list is a string, divides by ":". The last entry has the highest @@ -970,6 +974,17 @@ */ extern econf_err econf_getBoolValueDef(econf_file *kf, const char *group, const char *key, bool *result, const bool def); +/** @brief Check whether the value of the given group/key is enclosed by quotes. + * + * @param kf given/parsed data + * @param group Desired group or NULL if there is no group defined. + * @param key Key to check. + * @return bool true if the value is enclosed by quotes, false otherwise + * (also if kf is NULL or group/key has not been found). + * + */ +extern bool econf_hasQuotes(econf_file *kf, const char *group, const char *key); + /* --------------- */ /* --- SETTERS --- */ /* --------------- */ @@ -1062,6 +1077,19 @@ */ extern econf_err econf_setBoolValue(econf_file *kf, const char *group, const char *key, const char *value); +/** @brief Set whether the value of the given group/key has to be enclosed by quotes + * when the econf_file is written to a file. + * + * @param kf given/parsed data + * @param group Desired group or NULL if there is no group defined. + * @param key Key for which the quotes flag has to be set. + * @param quotes true if the value has to be enclosed by quotes, false otherwise. + * @return econf_err ECONF_SUCCESS or error code (e.g. ECONF_NOKEY if group/key + * has not been found). + * + */ +extern econf_err econf_setQuotes(econf_file *kf, const char *group, const char *key, const bool quotes); + /* --------------- */ /* --- HELPERS --- */ /* --------------- */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/lib/helpers.c new/libeconf-0.8.6/lib/helpers.c --- old/libeconf-0.8.5/lib/helpers.c 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/lib/helpers.c 2026-10-15 14:25:03.000000000 +0200 @@ -47,7 +47,7 @@ key_file->file_entry[num].value = strdup(KEY_FILE_NULL_VALUE); key_file->file_entry[num].comment_before_key = NULL; key_file->file_entry[num].comment_after_value = NULL; - key_file->file_entry[num].quotes = false; + key_file->file_entry[num].quotes = key_file->default_quotes; } char *get_absolute_path(const char *path, econf_err *error) { @@ -207,7 +207,7 @@ else copied_fe.comment_after_value = NULL; copied_fe.line_number = fe.line_number; - copied_fe.quotes = false; + copied_fe.quotes = fe.quotes; return copied_fe; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/lib/keyfile.h new/libeconf-0.8.6/lib/keyfile.h --- old/libeconf-0.8.5/lib/keyfile.h 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/lib/keyfile.h 2026-10-15 14:25:03.000000000 +0200 @@ -69,6 +69,10 @@ /* e.b. Identations will be handled like multiline entries. */ bool python_style; + /* Default value of the "quotes" flag for newly created entries */ + /* (entries not read from a file but added via the set functions). */ + bool default_quotes; + /* List of directories from which the configuration files have to be parsed. */ /* The last entry has the highest priority. */ char **parse_dirs; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/lib/libeconf.c new/libeconf-0.8.6/lib/libeconf.c --- old/libeconf-0.8.5/lib/libeconf.c 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/lib/libeconf.c 2026-10-15 14:25:03.000000000 +0200 @@ -112,6 +112,7 @@ key_file->comment = comment; key_file->join_same_entries = false; key_file->python_style = false; + key_file->default_quotes = false; key_file->parse_dirs = NULL; key_file->parse_dirs_count = 0; @@ -145,6 +146,7 @@ (*result)->length = 0; (*result)->join_same_entries = false; (*result)->python_style = false; + (*result)->default_quotes = false; (*result)->parse_dirs = NULL; (*result)->parse_dirs_count = 0; (*result)->conf_dirs = NULL; @@ -170,6 +172,11 @@ continue; } + if (strcmp(o_opt, "DEFAULT_QUOTES=1") == 0) { + (*result)->default_quotes = true; + continue; + } + if (strncmp(o_opt, PARSING_DIRS, strlen(PARSING_DIRS)) == 0) { (*result)->parse_dirs = malloc(sizeof(char *)); if ((*result)->parse_dirs == NULL) @@ -809,6 +816,21 @@ econf_getValue(String, char *) econf_getValue(Bool, bool) +bool econf_hasQuotes(econf_file *kf, const char *group, const char *key) +{ + if (!kf) + return false; + + size_t num; + char *grp = group ? strdup(group) : NULL; + econf_err error = find_key(*kf, stripbrackets(grp), key, &num); + free(grp); + if (error) + return false; + + return kf->file_entry[num].quotes; +} + /* SETTER FUNCTIONS */ /* The econf_set*Value functions are identical except for set value type, so let's create them via a macro. */ @@ -834,6 +856,24 @@ libeconf_setValue(String, const char *, value) libeconf_setValue(Bool, const char *, value) +econf_err econf_setQuotes(econf_file *kf, const char *group, const char *key, const bool quotes) +{ + if (!kf) + return ECONF_FILE_LIST_IS_NULL; + if (!key || strlen(key) <= 0) + return ECONF_EMPTYKEY; + + size_t num; + char *grp = group ? strdup(group) : NULL; + econf_err error = find_key(*kf, stripbrackets(grp), key, &num); + free(grp); + if (error) + return error; + + kf->file_entry[num].quotes = quotes; + return ECONF_SUCCESS; +} + /* --- DESTROY FUNCTIONS --- */ char **econf_freeArray(char** array) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/lib/libeconf.map new/libeconf-0.8.6/lib/libeconf.map --- old/libeconf-0.8.5/lib/libeconf.map 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/lib/libeconf.map 2026-10-15 14:25:03.000000000 +0200 @@ -80,4 +80,9 @@ LIBECONF_0.8 { global: econf_setExtValue; -} LIBECONF_0.7; \ No newline at end of file +} LIBECONF_0.7; +LIBECONF_0.9 { + global: + econf_hasQuotes; + econf_setQuotes; +} LIBECONF_0.8; \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/meson.build new/libeconf-0.8.6/meson.build --- old/libeconf-0.8.5/meson.build 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/meson.build 2026-10-15 14:25:03.000000000 +0200 @@ -7,7 +7,7 @@ 'b_pie=true', 'warning_level=3',], license : 'MIT', - version : '0.8.5', + version : '0.8.6', ) cc = meson.get_compiler('c') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/tests/CMakeLists.txt new/libeconf-0.8.6/tests/CMakeLists.txt --- old/libeconf-0.8.5/tests/CMakeLists.txt 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/tests/CMakeLists.txt 2026-10-15 14:25:03.000000000 +0200 @@ -64,6 +64,7 @@ tst-groups4 tst-parseconfig1 tst-quote1 + tst-quote2 tst-parse-error tst-getpath tst-write-string-data diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/tests/meson.build new/libeconf-0.8.6/tests/meson.build --- old/libeconf-0.8.5/tests/meson.build 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/tests/meson.build 2026-10-15 14:25:03.000000000 +0200 @@ -187,6 +187,9 @@ tst_quote1_exe = executable('tst-quote1', 'tst-quote1.c', c_args: test_args, dependencies : libeconf_dep) test('tst-quote1', tst_quote1_exe) +tst_quote2_exe = executable('tst-quote2', 'tst-quote2.c', c_args: test_args, dependencies : libeconf_dep) +test('tst-quote2', tst_quote2_exe) + tst_shells1_exe = executable('tst-shells1', 'tst-shells1.c', c_args: test_args, dependencies : libeconf_dep) test('tst-shells1', tst_shells1_exe) tst_shells2_exe = executable('tst-shells2', 'tst-shells2.c', c_args: test_args, dependencies : libeconf_dep) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/tests/tst-options.c new/libeconf-0.8.6/tests/tst-options.c --- old/libeconf-0.8.5/tests/tst-options.c 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/tests/tst-options.c 2026-10-15 14:25:03.000000000 +0200 @@ -22,7 +22,8 @@ if ((error = econf_newKeyFile_with_options(&key_file, "PARSING_DIRS=/test/usr/etc/:" \ "/test/run:test/etc" \ - ";JOIN_SAME_ENTRIES=1;PYTHON_STYLE=1"))) + ";JOIN_SAME_ENTRIES=1;PYTHON_STYLE=1" \ + ";DEFAULT_QUOTES=1"))) { fprintf (stderr, "ERROR: couldn't create new econf_file: %s\n", econf_errString(error)); @@ -34,16 +35,36 @@ fprintf (stderr, "ERROR: join_same_entries is false"); retval = 1; } - + if (!key_file->python_style) { fprintf (stderr, "ERROR: python_style is false"); retval = 1; } + if (!key_file->default_quotes) { + fprintf (stderr, "ERROR: default_quotes is false"); + retval = 1; + } + if (key_file->parse_dirs_count != 3) { fprintf (stderr, "ERROR: parse_dirs_count is not 3"); retval = 1; - } + } + + econf_free (key_file); + key_file = NULL; + + if ((error = econf_newKeyFile_with_options(&key_file, ""))) + { + fprintf (stderr, "ERROR: couldn't create new econf_file: %s\n", + econf_errString(error)); + return 1; + } + + if (key_file->default_quotes) { + fprintf (stderr, "ERROR: default_quotes is true but should default to false"); + retval = 1; + } econf_free (key_file); key_file = NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/tests/tst-quote1.c new/libeconf-0.8.6/tests/tst-quote1.c --- old/libeconf-0.8.5/tests/tst-quote1.c 2026-10-06 16:02:22.000000000 +0200 +++ new/libeconf-0.8.6/tests/tst-quote1.c 2026-10-15 14:25:03.000000000 +0200 @@ -55,27 +55,28 @@ static const struct { const char *const key; const char *const val; + const bool quotes; } tests[] = { - { "unquoted", "unquoted" }, - { "spaces_1", "spaces 1" }, - { "spaces_2", " spaces 2 " }, - { "mid_quote", "mid\"quote" }, - { "begin_quote", "\"begin_quote" }, - { "end_quote", "end quote\"", }, - { "quoted_word", "a \"quoted\" word", }, - { "quoted_word1", "a 'quoted' word", }, - { "quoted_string", "\"a quoted string\"", }, - { "quoted_string1", "'a quoted string'", }, - { "unbal1", "\"unbalanced", }, - { "unbal2", "unbalanced\"", }, - { "unbal3", "\"not \"well\" balanced", }, - { "unbal4", "not \"well\" balanced\"", }, - { "quoted_delim", "a=b", }, - { "quoted_delim1", "=>b", }, - { "unquoted_delim", "a=b", }, - { "unquoted_delim1", "=>b", }, - { "unquoted_delim2", "a=b", }, - { "unquoted_delim3", "=>b", }, + { "unquoted", "unquoted", false }, + { "spaces_1", "spaces 1", false }, + { "spaces_2", " spaces 2 ", true }, + { "mid_quote", "mid\"quote", false }, + { "begin_quote", "\"begin_quote", true }, + { "end_quote", "end quote\"", true }, + { "quoted_word", "a \"quoted\" word", true }, + { "quoted_word1", "a 'quoted' word", true }, + { "quoted_string", "\"a quoted string\"", true }, + { "quoted_string1", "'a quoted string'", true }, + { "unbal1", "\"unbalanced", true }, + { "unbal2", "unbalanced\"", false }, + { "unbal3", "\"not \"well\" balanced", true }, + { "unbal4", "not \"well\" balanced\"", false }, + { "quoted_delim", "a=b", true }, + { "quoted_delim1", "=>b", true }, + { "unquoted_delim", "a=b", false }, + { "unquoted_delim1", "=>b", false }, + { "unquoted_delim2", "a=b", false }, + { "unquoted_delim3", "=>b", false }, }; unsigned int i; @@ -89,6 +90,61 @@ { if (!check_String(key_file, group, tests[i].key, tests[i].val)) retval = 1; + + if (econf_hasQuotes(key_file, group, tests[i].key) != tests[i].quotes) + { + fprintf (stderr, "ERROR: econf_hasQuotes('%s') expected %d\n", + tests[i].key, tests[i].quotes); + retval = 1; + } + } + + if (econf_hasQuotes(key_file, group, "does_not_exist")) + { + fprintf (stderr, "ERROR: econf_hasQuotes for unknown key should be false\n"); + retval = 1; + } + + if (econf_hasQuotes(NULL, group, "unquoted")) + { + fprintf (stderr, "ERROR: econf_hasQuotes with NULL key_file should be false\n"); + retval = 1; + } + + if ((error = econf_setQuotes(key_file, group, "unquoted", true))) + { + fprintf (stderr, "ERROR: econf_setQuotes('unquoted', true) failed: %s\n", + econf_errString(error)); + retval = 1; + } + else if (!econf_hasQuotes(key_file, group, "unquoted")) + { + fprintf (stderr, "ERROR: econf_hasQuotes('unquoted') expected true after econf_setQuotes\n"); + retval = 1; + } + + if ((error = econf_setQuotes(key_file, group, "spaces_2", false))) + { + fprintf (stderr, "ERROR: econf_setQuotes('spaces_2', false) failed: %s\n", + econf_errString(error)); + retval = 1; + } + else if (econf_hasQuotes(key_file, group, "spaces_2")) + { + fprintf (stderr, "ERROR: econf_hasQuotes('spaces_2') expected false after econf_setQuotes\n"); + retval = 1; + } + + if (econf_setQuotes(key_file, group, "does_not_exist", true) != ECONF_NOKEY) + { + fprintf (stderr, "ERROR: econf_setQuotes for unknown key should return ECONF_NOKEY\n"); + retval = 1; + } + + if (econf_setQuotes(NULL, group, "unquoted", true) != ECONF_FILE_LIST_IS_NULL) + { + fprintf (stderr, "ERROR: econf_setQuotes with NULL key_file should return ECONF_FILE_LIST_IS_NULL\n"); + retval = 1; } econf_free(key_file); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.8.5/tests/tst-quote2.c new/libeconf-0.8.6/tests/tst-quote2.c --- old/libeconf-0.8.5/tests/tst-quote2.c 1970-01-01 01:00:00.000000000 +0100 +++ new/libeconf-0.8.6/tests/tst-quote2.c 2026-10-15 14:25:03.000000000 +0200 @@ -0,0 +1,174 @@ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include "libeconf.h" + +/* Test case: + Check that the "quotes" flag of newly created (not parsed from a file) + entries can be controlled via the DEFAULT_QUOTES option of + econf_newKeyFile_with_options as well as via econf_setQuotes, and that + econf_writeFile honors this flag by enclosing the written value in + quotes. +*/ + +static int +file_contains(const char *path, const char *needle) +{ + FILE *fp = fopen(path, "r"); + if (fp == NULL) + { + fprintf (stderr, "ERROR: couldn't open '%s'\n", path); + return 0; + } + + char buf[4096]; + size_t len = fread(buf, 1, sizeof(buf) - 1, fp); + buf[len] = '\0'; + fclose(fp); + + return strstr(buf, needle) != NULL; +} + +int +main(void) +{ + econf_err error; + int retval = 0; + const char *out_file = "tst-quote2-out.ini"; + const char *out_path = TESTSDIR "tst-quote2-out.ini"; + + /* --- Part 1: default behaviour (DEFAULT_QUOTES not set) --- */ + + econf_file *kf = NULL; + if ((error = econf_newKeyFile_with_options(&kf, ""))) + { + fprintf (stderr, "ERROR: couldn't create new econf_file: %s\n", + econf_errString(error)); + return 1; + } + econf_set_delimiter_tag(kf, '='); + econf_set_comment_tag(kf, '#'); + + if ((error = econf_setStringValue(kf, "test", "plain", "value1"))) + { + fprintf (stderr, "ERROR: couldn't set 'plain': %s\n", econf_errString(error)); + retval = 1; + } + + if (econf_hasQuotes(kf, "test", "plain")) + { + fprintf (stderr, "ERROR: 'plain' should not have quotes by default\n"); + retval = 1; + } + + if ((error = econf_setStringValue(kf, "test", "forced_quoted", "value2"))) + { + fprintf (stderr, "ERROR: couldn't set 'forced_quoted': %s\n", econf_errString(error)); + retval = 1; + } + + if ((error = econf_setQuotes(kf, "test", "forced_quoted", true))) + { + fprintf (stderr, "ERROR: couldn't set quotes for 'forced_quoted': %s\n", + econf_errString(error)); + retval = 1; + } + + if (!econf_hasQuotes(kf, "test", "forced_quoted")) + { + fprintf (stderr, "ERROR: 'forced_quoted' should have quotes after econf_setQuotes\n"); + retval = 1; + } + + if ((error = econf_writeFile(kf, TESTSDIR, out_file))) + { + fprintf (stderr, "ERROR: couldn't write '%s': %s\n", out_path, econf_errString(error)); + retval = 1; + } + else + { + if (!file_contains(out_path, "plain=value1")) + { + fprintf (stderr, "ERROR: expected unquoted 'plain=value1' in written file\n"); + retval = 1; + } + if (!file_contains(out_path, "forced_quoted=\"value2\"")) + { + fprintf (stderr, "ERROR: expected quoted 'forced_quoted=\"value2\"' in written file\n"); + retval = 1; + } + remove(out_path); + } + + econf_free(kf); + + /* --- Part 2: DEFAULT_QUOTES=1 --- */ + + econf_file *kf_def = NULL; + if ((error = econf_newKeyFile_with_options(&kf_def, "DEFAULT_QUOTES=1"))) + { + fprintf (stderr, "ERROR: couldn't create new econf_file with DEFAULT_QUOTES=1: %s\n", + econf_errString(error)); + return 1; + } + econf_set_delimiter_tag(kf_def, '='); + econf_set_comment_tag(kf_def, '#'); + + if ((error = econf_setStringValue(kf_def, "test", "default_quoted", "value3"))) + { + fprintf (stderr, "ERROR: couldn't set 'default_quoted': %s\n", econf_errString(error)); + retval = 1; + } + + if (!econf_hasQuotes(kf_def, "test", "default_quoted")) + { + fprintf (stderr, "ERROR: 'default_quoted' should have quotes due to DEFAULT_QUOTES=1\n"); + retval = 1; + } + + if ((error = econf_setStringValue(kf_def, "test", "forced_unquoted", "value4"))) + { + fprintf (stderr, "ERROR: couldn't set 'forced_unquoted': %s\n", econf_errString(error)); + retval = 1; + } + + if ((error = econf_setQuotes(kf_def, "test", "forced_unquoted", false))) + { + fprintf (stderr, "ERROR: couldn't clear quotes for 'forced_unquoted': %s\n", + econf_errString(error)); + retval = 1; + } + + if (econf_hasQuotes(kf_def, "test", "forced_unquoted")) + { + fprintf (stderr, "ERROR: 'forced_unquoted' should not have quotes after econf_setQuotes\n"); + retval = 1; + } + + if ((error = econf_writeFile(kf_def, TESTSDIR, out_file))) + { + fprintf (stderr, "ERROR: couldn't write '%s': %s\n", out_path, econf_errString(error)); + retval = 1; + } + else + { + if (!file_contains(out_path, "default_quoted=\"value3\"")) + { + fprintf (stderr, "ERROR: expected quoted 'default_quoted=\"value3\"' in written file\n"); + retval = 1; + } + if (!file_contains(out_path, "forced_unquoted=value4")) + { + fprintf (stderr, "ERROR: expected unquoted 'forced_unquoted=value4' in written file\n"); + retval = 1; + } + remove(out_path); + } + + econf_free(kf_def); + + return retval; +}
