Index: trunk/Ohana/src/opihi/dvo/avextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/avextract.c	(revision 16936)
+++ trunk/Ohana/src/opihi/dvo/avextract.c	(revision 19579)
@@ -3,5 +3,5 @@
 int avextract (int argc, char **argv) {
   
-  int i, j, n, m, N, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
+  int i, j, n, m, N, Npts, NPTS, last, next, state, Nfields, Nreturn, Ncstack, Nstack;
   int Nsecfilt, mode, VERBOSE;
   char **cstack, name[1024];
@@ -48,4 +48,9 @@
   fields = dbCmdlineFields (argc, argv, DVO_TABLE_AVERAGE, &last, &Nfields);
   if (fields == NULL) return (FALSE);
+
+  // examine line for 'where' or 'match to'.  'match to' is forbidden
+  state = dbCmdlineConditions (argc, argv, last, &next);
+  if (state == DVO_DB_CMDLINE_ERROR) goto escape;
+  if (state == DVO_DB_CMDLINE_IS_MATCH) goto escape; // not allowed for mextract
 
   // parse the remainder of the line as a boolean math expression
