Index: /trunk/Ohana/src/opihi/cmd.basic/input.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/input.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/cmd.basic/input.c	(revision 3907)
@@ -47,4 +47,5 @@
     free (inlist.line[i]);
   }
+  free (inlist.line[i]); /* note that we always alloc one extra line */
   free (inlist.line);
   return (status);
Index: /trunk/Ohana/src/opihi/cmd.basic/memory.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/memory.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/cmd.basic/memory.c	(revision 3907)
@@ -13,4 +13,24 @@
     return (TRUE);
   }
+  if (!strncasecmp ("variables", argv[1], strlen(argv[1]))) {
+    ListVariables ();
+    return (TRUE);
+  }
+  if (!strncasecmp ("vectors", argv[1], strlen(argv[1]))) {
+    ListVectors ();
+    return (TRUE);
+  }
+  if (!strncasecmp ("buffers", argv[1], strlen(argv[1]))) {
+    PrintBuffers (0);
+    return (TRUE);
+  }
+  if (!strncasecmp ("macros", argv[1], strlen(argv[1]))) {
+    ListMacros();
+    return (TRUE);
+  }
+  if (!strncasecmp ("commands", argv[1], strlen(argv[1]))) {
+    print_commands (stderr);
+    return (TRUE);
+  }
 
 usage:
Index: /trunk/Ohana/src/opihi/cmd.basic/run_for.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/run_for.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/cmd.basic/run_for.c	(revision 3907)
@@ -51,4 +51,5 @@
       }	
     }
+    if (ThisList == 0) ohana_memregister (input);
 
     /* test for new macro (or other list, in the future?) */
Index: /trunk/Ohana/src/opihi/cmd.basic/run_if.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/run_if.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/cmd.basic/run_if.c	(revision 3907)
@@ -61,4 +61,5 @@
       input = strcreate ("end");
     }
+    if (ThisList == 0) ohana_memregister (input);
 
     stripwhite (input);
Index: /trunk/Ohana/src/opihi/cmd.basic/run_while.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/run_while.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/cmd.basic/run_while.c	(revision 3907)
@@ -48,4 +48,5 @@
       }	
     }
+    if (ThisList == 0) ohana_memregister (input);
 
     /* test for new macro (or other list, in the future?) */
Index: /trunk/Ohana/src/opihi/lib.shell/MacroOps.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/MacroOps.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/lib.shell/MacroOps.c	(revision 3907)
@@ -56,4 +56,11 @@
   }
   return;
+}
+
+void ListMacros () {
+  int i;
+  for (i = 0; i < Nmacros; i++) {
+    fprintf (stderr, "%s\n", macros[i].name);
+  }
 }
 
Index: /trunk/Ohana/src/opihi/lib.shell/macro_create.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/macro_create.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/lib.shell/macro_create.c	(revision 3907)
@@ -46,5 +46,4 @@
     AddCommand (cmd);
     free (cmd);
-
     macro = NewMacro (argv[1]);
   } else { /**** Old Macro ****/
@@ -58,5 +57,5 @@
   NLINES = D_NLINES;
   for (i = 0; i < macro[0].Nlines; i++) free (macro[0].line[i]);
-  ALLOCATE (macro[0].line, char *, NLINES);
+  REALLOCATE (macro[0].line, char *, NLINES);
 
   /* read in macro
@@ -79,4 +78,5 @@
       continue;
     }
+    if (ThisList == 0) ohana_memregister (input);
 
     if ((ThisList > 0) && (input == (char *) NULL)) {
@@ -96,6 +96,5 @@
 	free (input);
 	macro[0].Nlines = i;
-	if (macro[0].Nlines == 0) 
-	  i = 1;
+	if (macro[0].Nlines == 0) i = 1;
 	REALLOCATE (macro[0].line, char *, i);
 	return (TRUE);
Index: /trunk/Ohana/src/opihi/lib.shell/opihi.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/opihi.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/lib.shell/opihi.c	(revision 3907)
@@ -43,7 +43,7 @@
       add_history (line);
       append_history (1, history);
-      free (line);
       free (list);
     }
+    free (line);
     line = (char *) NULL;
   }
Index: /trunk/Ohana/src/opihi/pantasks/task.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/pantasks/task.c	(revision 3907)
@@ -58,4 +58,5 @@
       input = strcreate ("end");
     }
+    if (ThisList == 0) ohana_memregister (input);
 
     stripwhite (input);
Index: /trunk/Ohana/src/opihi/pantasks/task_macros.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task_macros.c	(revision 3906)
+++ /trunk/Ohana/src/opihi/pantasks/task_macros.c	(revision 3907)
@@ -126,4 +126,5 @@
       input = strcreate ("end");
     }
+    if (ThisList == 0) ohana_memregister (input);
 
     stripwhite (input);
