From a4edc46a5f21d51278f83bda548290b68f2bb0ad Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 20 Mar 2013 16:53:10 -0500 Subject: [PATCH] dbStatic: Allow empty DB & DBD files They used to cause a Syntax error with a bad context string. --- documentation/RELEASE_NOTES.html | 7 +++++++ src/dbStatic/dbYacc.y | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 98c9415b1..f62a502c7 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -13,6 +13,13 @@ +

Allow empty database files

+ +

The IOC used to report an error if dbLoadRecords or dbLoadDatabase was asked +to load an empty file or one containing just whitespace and/or comments. Such +files are now permitted, simplifying the task of automated database generation +programs which might discover they have nothing to output.

+

High-Resolution Time Provider on MacOS

MacOS does not provide the clock_gettime() API with CLOCK_REALTIME that other diff --git a/src/dbStatic/dbYacc.y b/src/dbStatic/dbYacc.y index b61ab26ea..b8cc9b4cf 100644 --- a/src/dbStatic/dbYacc.y +++ b/src/dbStatic/dbYacc.y @@ -31,7 +31,13 @@ static int yyAbort = 0; %% -database: database database_item | database_item; +database: /* empty */ + | database_item_list + ; + +database_item_list: database_item_list database_item + | database_item + ; database_item: include | path