flags.c: drop empty-string flags

Also issue a scripting error warning

(cherry picked from commit 2a547f6929459e3cdaa1e7c8dc3a8980f2ae4ca8)