aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2023-02-05 11:20:10 +0100
committert3sserakt <t3ss@posteo.de>2023-02-05 11:20:10 +0100
commit54638eb127fa967972bdbc7e887f12948d037409 (patch)
tree6010f9b85604ee5727ef9272afbe897bf24521f9 /src
parenta7ed3578f84d98fba07e0da8999bff9cbed54d98 (diff)
parent6b0475afe46431f55cf6588bc9add529f9a0c773 (diff)
downloadgnunet-54638eb127fa967972bdbc7e887f12948d037409.tar.gz
gnunet-54638eb127fa967972bdbc7e887f12948d037409.zip
Merge branch 'master' of ssh://git.gnunet.org/gnunet
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_mysql_compat.h.in (renamed from src/include/gnunet_mysql_compat.h)12
-rw-r--r--src/util/configuration.c24
2 files changed, 20 insertions, 16 deletions
diff --git a/src/include/gnunet_mysql_compat.h b/src/include/gnunet_mysql_compat.h.in
index 9fb9db30f..6218386aa 100644
--- a/src/include/gnunet_mysql_compat.h
+++ b/src/include/gnunet_mysql_compat.h.in
@@ -22,6 +22,8 @@
22 * 22 *
23 * @file 23 * @file
24 * MySQL/MariaDB compatibility insanity helper header 24 * MySQL/MariaDB compatibility insanity helper header
25 * Note: gnunet_mysql_compat.h is AUTOGENERATED from gnunet_mysql_compat.h.in
26 * Please do not modify or commit gnunet_mysql_compat.h
25 * 27 *
26 * @defgroup mysql MySQL library 28 * @defgroup mysql MySQL library
27 * Helper library to access a MySQL database. 29 * Helper library to access a MySQL database.
@@ -41,15 +43,7 @@ extern "C"
41#endif 43#endif
42#endif 44#endif
43 45
44#ifndef LIBMARIADB 46#define MYSQL_BOOL @mysql_bool@
45#if MYSQL_VERSION_ID >= 80000
46#define MYSQL_BOOL bool
47#else
48#define MYSQL_BOOL my_bool /* MySQL < 8 wants this */
49#endif
50#else
51#define MYSQL_BOOL my_bool /* MariaDB still uses my_bool */
52#endif
53 47
54#if 0 /* keep Emacsens' auto-indent happy */ 48#if 0 /* keep Emacsens' auto-indent happy */
55{ 49{
diff --git a/src/util/configuration.c b/src/util/configuration.c
index 1a66458db..b7ca377a9 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -801,7 +801,8 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
801 *end = '\0'; 801 *end = '\0';
802 directive = line + 1; 802 directive = line + 1;
803 803
804 if (0 == strcasecmp (directive, "INLINE")) 804 if (0 == strcasecmp (directive,
805 "INLINE"))
805 { 806 {
806 const char *path = end + 1; 807 const char *path = end + 1;
807 808
@@ -816,7 +817,8 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
816 source_filename, 817 source_filename,
817 nr); 818 nr);
818 } 819 }
819 else if (0 == strcasecmp (directive, "INLINE-MATCHING")) 820 else if (0 == strcasecmp (directive,
821 "INLINE-MATCHING"))
820 { 822 {
821 const char *path = end + 1; 823 const char *path = end + 1;
822 824
@@ -831,7 +833,8 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
831 source_filename, 833 source_filename,
832 nr); 834 nr);
833 } 835 }
834 else if (0 == strcasecmp (directive, "INLINE-SECRET")) 836 else if (0 == strcasecmp (directive,
837 "INLINE-SECRET"))
835 { 838 {
836 char *secname = end + 1; 839 char *secname = end + 1;
837 char *secname_end; 840 char *secname_end;
@@ -881,7 +884,8 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
881 } 884 }
882 continue; 885 continue;
883 } 886 }
884 if (('[' == line[0]) && (']' == line[line_size - 1])) 887 if ( ('[' == line[0]) &&
888 (']' == line[line_size - 1]) )
885 { 889 {
886 /* [value] */ 890 /* [value] */
887 line[line_size - 1] = '\0'; 891 line[line_size - 1] = '\0';
@@ -923,18 +927,24 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
923 927
924 /* remove quotes */ 928 /* remove quotes */
925 i = 0; 929 i = 0;
926 if (('"' == value[0]) && ('"' == value[strlen (value) - 1])) 930 if ( ('"' == value[0]) &&
931 ('"' == value[strlen (value) - 1]) )
927 { 932 {
928 value[strlen (value) - 1] = '\0'; 933 value[strlen (value) - 1] = '\0';
929 value++; 934 value++;
930 } 935 }
931 GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, &value[i]); 936 GNUNET_CONFIGURATION_set_value_string (cfg,
937 section,
938 tag,
939 &value[i]);
932 if (cfg->diagnostics) 940 if (cfg->diagnostics)
933 { 941 {
934 set_entry_hint (cfg, 942 set_entry_hint (cfg,
935 section, 943 section,
936 tag, 944 tag,
937 source_filename ? source_filename : "<input>", 945 source_filename
946 ? source_filename
947 : "<input>",
938 nr); 948 nr);
939 } 949 }
940 GNUNET_free (tag); 950 GNUNET_free (tag);