Allow empty CQL transform in cql2pqf (and reverse)
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 14 Aug 2009 13:31:21 +0000 (15:31 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 14 Aug 2009 13:31:21 +0000 (15:31 +0200)
If value dash (-) is tiven as properties name, the cql2pqf program
will use no properties file.. Ie just cql_transform_create rather than
cql_transform_open_fname. This allows us to test RPN to CQL conversion
with no properties file (-r).

util/cql2pqf.c

index d5b2390..ba7c1a9 100644 (file)
@@ -48,7 +48,10 @@ int main(int argc, char **argv)
     }
     if (!fname)
         usage();
     }
     if (!fname)
         usage();
-    ct = cql_transform_open_fname(fname);
+    if (!strcmp(fname, "-"))
+        ct = cql_transform_create();
+    else
+        ct = cql_transform_open_fname(fname);
     if (!ct)
     {
         fprintf(stderr, "failed to read properties %s\n", fname);
     if (!ct)
     {
         fprintf(stderr, "failed to read properties %s\n", fname);