Compare commits

..

3 Commits

Author SHA1 Message Date
1a76b2032e Add a slogan of sorts 2020-08-01 14:03:23 +02:00
722ef65c1f Name change 2020-08-01 14:02:25 +02:00
317dfcb6e2 Improve setjmp safety in config parser 2020-04-19 07:02:13 +02:00
6 changed files with 16 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014 - 2018, Přemysl Janouch <p@janouch.name>
Copyright (c) 2014 - 2018, Přemysl Eric Janouch <p@janouch.name>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

View File

@@ -1,7 +1,7 @@
/*
* liberty-proto.c: the ultimate C unlibrary: protocols
*
* Copyright (c) 2014 - 2016, Přemysl Janouch <p@janouch.name>
* Copyright (c) 2014 - 2016, Přemysl Eric Janouch <p@janouch.name>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.

View File

@@ -1,7 +1,7 @@
/*
* liberty-tui.c: the ultimate C unlibrary: TUI
*
* Copyright (c) 2016 - 2017, Přemysl Janouch <p@janouch.name>
* Copyright (c) 2016 - 2017, Přemysl Eric Janouch <p@janouch.name>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.

View File

@@ -1,7 +1,7 @@
/*
* liberty.c: the ultimate C unlibrary
*
* Copyright (c) 2014 - 2018, Přemysl Janouch <p@janouch.name>
* Copyright (c) 2014 - 2018, Přemysl Eric Janouch <p@janouch.name>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.
@@ -117,6 +117,9 @@ extern char **environ;
#define CONTAINER_OF(pointer, type, member) \
((type *) ((char *) pointer - offsetof (type, member)))
char *liberty = "They who can give up essential liberty to obtain a little "
"temporary safety deserve neither liberty nor safety.";
// --- Logging -----------------------------------------------------------------
static void
@@ -5254,7 +5257,9 @@ static struct config_item *
config_item_parse (const char *script, size_t len,
bool single_value_only, struct error **e)
{
struct config_parser parser = config_parser_make (script, len);
volatile struct config_parser parser = config_parser_make (script, len);
struct config_parser *volatile self = (struct config_parser *) &parser;
struct config_item *volatile object = NULL;
jmp_buf err;
@@ -5276,13 +5281,13 @@ config_item_parse (const char *script, size_t len,
// This is really only intended for in-program configuration
// and telling the line number would look awkward
parser.tokenizer.report_line = false;
object = config_parser_parse_value (&parser, err);
object = config_parser_parse_value (self, err);
}
else
object = config_parser_parse_object (&parser, err);
config_parser_expect (&parser, CONFIG_T_ABORT, err);
object = config_parser_parse_object (self, err);
config_parser_expect (self, CONFIG_T_ABORT, err);
end:
config_parser_free (&parser);
config_parser_free (self);
return object;
}

View File

@@ -1,7 +1,7 @@
/*
* tests/liberty.c
*
* Copyright (c) 2015 - 2016, Přemysl Janouch <p@janouch.name>
* Copyright (c) 2015 - 2016, Přemysl Eric Janouch <p@janouch.name>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.

View File

@@ -1,7 +1,7 @@
/*
* tests/proto.c
*
* Copyright (c) 2015, Přemysl Janouch <p@janouch.name>
* Copyright (c) 2015, Přemysl Eric Janouch <p@janouch.name>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.