Index: trunk/Ohana/src/opihi/dvo/fitsed.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/fitsed.c	(revision 13479)
+++ trunk/Ohana/src/opihi/dvo/fitsed.c	(revision 14401)
@@ -27,5 +27,4 @@
   int Nsecfilt, status;
   void *oldsignal;
-  char *RegionName, *RegionList;
   char name[64], line[1024], key[20];
   float *fitmags, *fiterrs, *wavecode, *vegaToAB;
@@ -43,4 +42,6 @@
   Catalog catalog, outcat;
   SkyList *skylist;
+  SkyRegionSelection *selection;
+
   SEDtableRow *SEDtableRaw, **SEDtable;
   SEDtableRow sourceValue, sourceError;
@@ -49,4 +50,6 @@
   /* defaults */
   skylist  = NULL;
+  selection = NULL;
+
   catalog.average = NULL;
   catalog.measure = NULL;
@@ -63,6 +66,4 @@
   wavecode = NULL;
   hashcode = NULL;
-  RegionName = NULL;
-  RegionList = NULL;
   magSection.name = NULL;
   resSection.name = NULL;
@@ -81,5 +82,5 @@
 
   /* interpret command-line options */
-  if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape;
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
   if (!SetPhotSelections (&argc, argv, 4)) goto usage;
 
@@ -179,5 +180,5 @@
 
   /* load region corresponding to selection above */
-  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
+  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
 
   /* loop over regions, extract data for each region */
@@ -361,7 +362,6 @@
 
 finish:
-  if (skylist != NULL) SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
-  if (RegionName != NULL) free (RegionName);
-  if (RegionList != NULL) free (RegionList);
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
   if (wavecode != NULL) free (wavecode);
   if (hashcode != NULL) free (hashcode);
