Index: Singular/LIB/all.lib
===================================================================
--- Singular/LIB/all.lib	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/LIB/all.lib	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -1,6 +1,6 @@
-// $Id: all.lib,v 1.21 1999-08-16 10:55:45 obachman Exp $
+// $Id: all.lib,v 1.22 1999-10-22 09:07:07 obachman Exp $
 ///////////////////////////////////////////////////////////////////////////////
 
-version="$Id: all.lib,v 1.21 1999-08-16 10:55:45 obachman Exp $";
+version="$Id: all.lib,v 1.22 1999-10-22 09:07:07 obachman Exp $";
 info="
 LIBRARY:  all.lib   Load all libraries
@@ -17,4 +17,5 @@
   invar.lib     PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS
   latex.lib     PROCEDURES FOR TYPESET OF SINGULAROBJECTS IN LATEX2E
+  linalg.lib    PROCEDURES FOR PROCEDURES FOR ALGORITHMIC LINEAR ALGEBRA
   matrix.lib    PROCEDURES FOR MATRIX OPERATIONS
   normal.lib    PROCEDURES FOR COMPUTING THE NORMALIZATION
@@ -50,4 +51,5 @@
 LIB "invar.lib";
 LIB "latex.lib";
+LIB "linalg.lib";
 LIB "matrix.lib";
 LIB "normal.lib";
Index: Singular/LIB/general.lib
===================================================================
--- Singular/LIB/general.lib	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/LIB/general.lib	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -1,7 +1,7 @@
-// $Id: general.lib,v 1.21 1999-09-27 17:54:57 Singular Exp $
+// $Id: general.lib,v 1.22 1999-10-22 09:07:07 obachman Exp $
 //GMG, last modified 18.6.99
 ///////////////////////////////////////////////////////////////////////////////
 
-version="$Id: general.lib,v 1.21 1999-09-27 17:54:57 Singular Exp $";
+version="$Id: general.lib,v 1.22 1999-10-22 09:07:07 obachman Exp $";
 info="
 LIBRARY:  general.lib   PROCEDURES OF GENERAL TYPE
@@ -413,4 +413,7 @@
          killall(\"not\", \"type_name\"); kills all user-defined variables,
          except those of type \"type_name\" and except loaded procedures
+         killall(\"not\", \"name_1\", \"name_2\", ...); 
+         kills all user-defined variables, except those of name \"name_i\" 
+         and except loaded procedures
 RETURN:  no return value
 NOTE:    killall should never be used inside a procedure
@@ -418,41 +421,69 @@
 "
 {
-   list L=names(); int joni=size(L);
-   if( size(#)==0 )
-   {
-      for ( ; joni>0; joni-- )
-      {
-         if( L[joni]!="LIB" and typeof(`L[joni]`)!="proc" ) { kill `L[joni]`; }
-      }
-   }
-   else
-   {
-     if( size(#)==1 )
-     {
-       if( #[1] == "proc" )
-       {
-          for ( joni=size(L); joni>0; joni-- )
+  list L=names(); int joni=size(L);
+  int no_kill, j;
+  for (j=1; j<=size(#); j++)
+  {
+    if (typeof(#[j]) != "string")
+    {
+      ERROR("Need string as " + string(j) + "th argument");
+    }
+  }
+  
+  // kills all user-defined variables but not loaded procedures
+  if( size(#)==0 )
+  {
+    for ( ; joni>0; joni-- )
+    {
+      if( L[joni]!="LIB" and typeof(`L[joni]`)!="proc" ) { kill `L[joni]`; }
+    }
+  }
+  else
+  {
+    // kills all user-defined variables
+    if( size(#)==1 )
+    {
+      // of type proc
+      if( #[1] == "proc" )
+      {
+        for ( joni=size(L); joni>0; joni-- )
+        {
+          if((L[joni]!="killall") and (L[joni]=="LIB" or typeof(`L[joni]`)=="proc"))
+          { kill `L[joni]`; }
+        }
+      }
+      else
+      {  
+        // other types
+        for ( ; joni>2; joni-- )
+        {
+          if(typeof(`L[joni]`)==#[1] and L[joni]!="LIB" and typeof(`L[joni]`)!="proc") { kill `L[joni]`; }
+        }
+      }
+    }
+    else
+    {
+      // kills all user-defined variables whose name or type is not #i 
+      for ( ; joni>2; joni-- )
+      {
+        if ( L[joni] != "LIB" && typeof(`L[joni]`) != "proc")
+        {
+          no_kill = 0;
+          for (j=2; j<= size(#); j++)
           {
-             if((L[joni]!="killall") and (L[joni]=="LIB" or typeof(`L[joni]`)=="proc"))
-               { kill `L[joni]`; }
+            if (typeof(`L[joni]`)==#[j] or L[joni] == #[j])
+            {
+              no_kill = 1;
+              break;
+            }
           }
-       }
-       else
-       {
-          for ( ; joni>2; joni-- )
+          if (! no_kill)
           {
-            if(typeof(`L[joni]`)==#[1] and L[joni]!="LIB" and typeof(`L[joni]`)!="proc") { kill `L[joni]`; }
+            kill `L[joni]`;
           }
         }
-     }
-     else
-     {
-        for ( ; joni>2; joni-- )
-        {
-          if(typeof(`L[joni]`)!=#[2] and L[joni]!="LIB" and typeof(`L[joni]`)!="proc") { kill `L[joni]`; }
-        }
-     }
+      }
+    }
   }
-  return();
 }
 example
Index: Singular/LIB/linalg.lib
===================================================================
--- Singular/LIB/linalg.lib	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/LIB/linalg.lib	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -3,5 +3,5 @@
 //////////////////////////////////////////////////////////////////////////////
 
-version="$Id: linalg.lib,v 1.1 1999-08-18 12:07:02 siebert Exp $";
+version="$Id: linalg.lib,v 1.2 1999-10-22 09:07:07 obachman Exp $";
 info="
 LIBRARY:  linalg.lib	PROCEDURES FOR ALGORITHMIC LINEAR ALGEBRA
@@ -16,5 +16,5 @@
  diag_test(A);
  busadj(A);         coefficients of Adj(E*t-A) and coefficients of det(E*t-A)
- charpoly(A,v);     characteristic polynom of A. ( using busadj(A) ) 
+ charpoly(A,v);     characteristic polynomial of A. ( using busadj(A) ) 
  adj(A);            ( using busadj(A) )
  det_B(A);          determinant of A. ( uses busadj(A) )
@@ -353,9 +353,9 @@
 "USAGE:   busadj(A);  A =  square matrix
 RETURN:  list L; 
-         L[1] contains the (n+1)coefficients of the characteristic polynom of A
+         L[1] contains the (n+1)coefficients of the characteristic polynomial of A
               X=L[1][1]+..+L[1][k]*t^(k-1)+..+(L[1][n+1]=1)*t^n
          L[2] contains the n matrices Hk of type nxn with
               bA=(Hn-1)*t^(n-1)+...+H0   ,( Hk=L[2][k+1] ) 
-              this matrix polynom forms the busadjunkte bA=adj(E*t-A)
+              this matrix polynomial forms the busadjoint bA=adj(E*t-A)
 EXAMPLE: example busadj; shows an example"
 {
@@ -410,5 +410,5 @@
 "USAGE:   charpoly(A,v); A = square matrix, v = name of a ringvariable
 NOTE:    A must be constant in the variable v. The computation uses busadj(A).
-RETURN:  poly, characteristic polynom det(E*v-A)
+RETURN:  poly, characteristic polynomial det(E*v-A)
 EXAMPLE: example charpoly; shows an example"
 {
@@ -480,5 +480,5 @@
 "USAGE:    adj(A);  A = square matrix
 NOTE:     computation uses busadj(A)
-RETURN:   englisch(Adjunkte?) 
+RETURN:   adjoint 
 EXAMPLE:  example adj; shows an example"
 {
@@ -514,5 +514,5 @@
 RETURN:    list Inv with Inv[1]=matrix I and Inv[2]=poly p 
            and I*A = unitmat(n)*p; 
-NOTE:      p=1 if 1/det(A) is computeable and  p=det(A) if not
+NOTE:      p=1 if 1/det(A) is computable and  p=det(A) if not
 EXAMPLE:   example inverse_B; shows an example"
 {
@@ -585,5 +585,5 @@
 RETURN:    list Inv with Inv[1]=matrix I and Inv[2]=poly p 
            and I*A = unitmat(n)*p; 
-NOTE:      p=1 if 1/det(A) is computeable and  p=det(A) if not
+NOTE:      p=1 if 1/det(A) is computable and  p=det(A) if not
 EXAMPLE:   example inverse_L; shows an example"
 {
@@ -635,9 +635,7 @@
 proc gaussred(matrix A)
 "USAGE:     gaussred(A);   any constant matrix A
-RETURN:    list Z:  Z[1]=P , Z[2]=U , Z[3]=S , Z[4]=rank(ENGLISCH?)
-           gives an row reduced matrix S, a permutation matrix P and a
-           normalized (untere Dreiecksmatrix->ENGLISCH?) U , with
-
-                    P*A=U*S            
+RETURN:    list Z:  Z[1]=P , Z[2]=U , Z[3]=S , Z[4]=rank(A)
+           gives a row reduced matrix S, a permutation matrix P and a
+           normalized lower triangular matrix U , with P*A=U*S            
 EXAMPLE:   example gaussred; shows an example"
 {
@@ -718,7 +716,5 @@
 "EXAMPLE";echo=2;
 ring r=0,(x),dp;
-int n=random(1,10);
-int m=random(1,10);
-matrix A[n][m]=random(10,n,m);
+matrix A[5][4]=1,3,-1,4,2,5,-1,3,1,3,-1,4,0,4,-3,1,-3,1,-5,-2;
 print(A);
 list Z=gaussred(A);
@@ -734,8 +730,7 @@
 proc gaussred_pivot(matrix A)
 "USAGE:     gaussred(A);   any constant matrix A
-RETURN:    list Z:  Z[1]=P , Z[2]=U , Z[3]=S , Z[4]=rank(ENGLISCH?)
-           gives an row reduced matrix S, a permutation matrix P and a
-           normalized (untere Dreiecksmatrix->ENGLISCH?) U , with
-
+RETURN:    list Z:  Z[1]=P , Z[2]=U , Z[3]=S , Z[4]=rank(A)
+           gives n row reduced matrix S, a permutation matrix P and a
+           normalized lower triangular matrix U , with
                     P*A=U*S
 NOTE:      with row pivoting            
@@ -816,7 +811,5 @@
 "EXAMPLE";echo=2;
 ring r=0,(x),dp;
-int n=random(1,10);
-int m=random(1,10);
-matrix A[n][m]=random(10,n,m);
+matrix A[5][4]=1,3,-1,4,2,5,-1,3,1,3,-1,4,0,4,-3,1,-3,1,-5,-2;
 print(A);
 list Z=gaussred(A);
@@ -876,9 +869,8 @@
 "USAGE:     gaussred(A);   constant invertible matrix A
 RETURN:    list Z:  Z[1]=P , Z[2]=U , Z[3]=D , Z[4]=O
-           gives an row reduced matrix S, a permutation matrix P and a
-           normalized (untere Dreiecksmatrix->ENGLISCH?) U , with
-
-                    P*A=U*D*O
-           D diagonal matrix, O normalized (obere Dreiecksmatrix->ENGLISCH)
+           gives a permutation matrix P, a
+           normalized lower triangular matrix U ,
+           a diagonal matrix D, and a normalized upper triangular matrix O
+           withP*A=U*D*O
 NOTE:      Z[1]=-1 means A is not regular
 EXAMPLE:   example gaussred; shows an example"
Index: Singular/LIB/tst.lib
===================================================================
--- Singular/LIB/tst.lib	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/LIB/tst.lib	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -1,7 +1,7 @@
-// $Id: tst.lib,v 1.18 1999-10-19 17:17:17 obachman Exp $
+// $Id: tst.lib,v 1.19 1999-10-22 09:07:08 obachman Exp $
 //(obachman, last modified 6/30/98)
 /////////////////////////////////////////////////////////////////////////////
 
-version="$Id: tst.lib,v 1.18 1999-10-19 17:17:17 obachman Exp $";
+version="$Id: tst.lib,v 1.19 1999-10-22 09:07:08 obachman Exp $";
 info="
 LIBRARY:  tst.lib      PROCEDURES FOR RUNNING AUTOMATIC TST TESTS
@@ -22,5 +22,4 @@
 
 /////////////////////////////////////////////////////////////////////////////
-
 proc tst_system(string s, list #)
 "USAGE:    tst_system(s); s string
Index: Singular/extra.cc
===================================================================
--- Singular/extra.cc	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/extra.cc	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR      *
 *****************************************/
-/* $Id: extra.cc,v 1.110 1999-10-14 14:27:02 obachman Exp $ */
+/* $Id: extra.cc,v 1.111 1999-10-22 09:07:00 obachman Exp $ */
 /*
 * ABSTRACT: general interface to internals of Singular ("system" command)
@@ -579,4 +579,25 @@
 #endif
 #endif /* HAVE_DYNAMIC_LOADING */
+
+/*==================== mtrack ==================================*/
+    if(strcmp(sys_cmd,"mtrack")==0)
+    {
+#ifdef MLIST
+      FILE *fd = NULL; 
+      if ((h!=NULL) &&(h->Typ()==STRING_CMD))
+      {
+        fd = fopen((char*) h->Data(), "w");
+        if (fd == NULL)
+          Warn("Can not open %s for writing og mtrack. Using stdout");
+      }
+      mmTestList((fd == NULL ? stdout: fd), 0);
+      if (fd != NULL) fclose(fd);
+      return FALSE;
+#else
+     WerrorS("mtrack not supported without MLIST"); 
+     return TRUE;
+#endif     
+    }
+    else
 /*==================== naIdeal ==================================*/
     if(strcmp(sys_cmd,"naIdeal")==0)
Index: Singular/iparith.cc
===================================================================
--- Singular/iparith.cc	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/iparith.cc	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: iparith.cc,v 1.182 1999-10-20 13:30:01 obachman Exp $ */
+/* $Id: iparith.cc,v 1.183 1999-10-22 09:07:01 obachman Exp $ */
 
 /*
@@ -1852,4 +1852,5 @@
   int wmaxl=maxl;
   ideal u_id=(ideal)u->Data();
+  
   maxl--;
   if ((maxl==-1) && (iiOp!=MRES_CMD))
Index: Singular/kstd1.cc
===================================================================
--- Singular/kstd1.cc	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/kstd1.cc	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: kstd1.cc,v 1.42 1999-10-20 07:33:40 siebert Exp $ */
+/* $Id: kstd1.cc,v 1.43 1999-10-22 09:07:02 obachman Exp $ */
 /*
 * ABSTRACT:
@@ -1425,4 +1425,5 @@
   }
   if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
+  idTest(strat->Shdl);
   return (strat->Shdl);
 }
Index: Singular/mmbt.c
===================================================================
--- Singular/mmbt.c	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/mmbt.c	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mmbt.c,v 1.12 1999-10-14 14:27:18 obachman Exp $ */
+/* $Id: mmbt.c,v 1.13 1999-10-22 09:07:03 obachman Exp $ */
 /*
 * ABSTRACT: backtrace: part of memory subsystem (for linux/elf)
@@ -71,5 +71,5 @@
 
   while ((fp!=NULL) && ((unsigned long)fp>4095)  
-/*  && ((unsigned long)fp < ((unsigned long)0x80000000)) */
+  && ((unsigned long)fp < ((unsigned long)0xf0000000))
   && *fp && (pc = getpc (fp)) 
   && !entrypc (pc) && (i<BT_MAXSTACK))
@@ -159,35 +159,35 @@
 }
 
-void mmPrintStack(unsigned long *stack, int all)
-{
-  mmPrintStackFrames(stack, 0, BT_MAXSTACK, all);
-}
-
-void mmDBPrintThisStack(void* memblock, int all, int free)
+void mmPrintStack(FILE *fd, unsigned long *stack, int all)
+{
+  mmPrintStackFrames(fd, stack, 0, BT_MAXSTACK, all);
+}
+
+void mmDBPrintThisStack(FILE *fd, void* memblock, int all, int free)
 {
 #ifdef MTRACK_FREE
   if (free)
-    mmPrintStackFrames(((DBMCB*) memblock)->bt_freed_stack, 0, BT_MAXSTACK, all);
+    mmPrintStackFrames(fd, ((DBMCB*) memblock)->bt_freed_stack, 0, BT_MAXSTACK, all);
   else
 #endif
-    mmPrintStackFrames(((DBMCB*) memblock)->bt_allocated_stack, 0, BT_MAXSTACK, all);
+    mmPrintStackFrames(fd, ((DBMCB*) memblock)->bt_allocated_stack, 0, BT_MAXSTACK, all);
 }
     
-void mmDBPrintStack(void* memblock, int all)
-{
-  mmPrintStackFrames(((DBMCB*) memblock)->bt_allocated_stack, 0, BT_MAXSTACK, all);
-}
-
-void mmDBPrintStackFrames(void* memblock, int start, int end)
-{
-  mmPrintStackFrames(((DBMCB*) memblock)->bt_allocated_stack, start, end, 
+void mmDBPrintStack(FILE *fd, void* memblock, int all)
+{
+  mmPrintStackFrames(fd, ((DBMCB*) memblock)->bt_allocated_stack, 0, BT_MAXSTACK, all);
+}
+
+void mmDBPrintStackFrames(FILE *fd, void* memblock, int start, int end)
+{
+  mmPrintStackFrames(fd, ((DBMCB*) memblock)->bt_allocated_stack, start, end, 
                      MM_PRINT_ALL_STACK);
 }
 
 /* print stack */
-void mmPrintStackFrames(unsigned long *bt_stack, int start, int end, int mm) 
+void mmPrintStackFrames(FILE *fd, unsigned long *bt_stack, int start, int end, int mm) 
 {
   int i=start;
-  PrintS(" ");
+  fprintf( fd," ");
   do
   {
@@ -197,12 +197,12 @@
     {
       if ((mm & MM_PRINT_ALL_STACK) || strncmp(s, "mm", 2) !=0)
-        fprintf( stderr,":%s",s);
+        fprintf( fd,":%s",s);
       if (strcmp(s, "main") == 0) break;
     }
     else
-      fprintf( stderr,":%lx",(long)bt_stack[i]);
+      fprintf( fd,":%lx",(long)bt_stack[i]);
     i++;
   } while ((i<end) && (bt_stack[i]!=0));
-  fprintf( stderr,"\n");
+  fprintf( fd,"\n");
 }
 #endif /* linux, i386 */
Index: Singular/mmbt.h
===================================================================
--- Singular/mmbt.h	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/mmbt.h	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mmbt.h,v 1.4 1999-09-29 17:03:35 obachman Exp $ */
+/* $Id: mmbt.h,v 1.5 1999-10-22 09:07:04 obachman Exp $ */
 /*
 * ABSTRACT: backtrace: part of memory subsystem (for linux/elf)
@@ -26,9 +26,9 @@
 void mmP2cNameInit(); /* init. of PC -> Name resolution */
 char * mmP2cName(unsigned long p); /* PC -> Name resolution */
-void mmPrintStack(unsigned long *stack, int mm);
-void mmDBPrintStack(void* memblock, int mm);
-void mmDBPrintStackFrames(void* memblock, int start, int end);
-void mmPrintStackFrames(unsigned long *bt_stack, int start, int end, int mm); 
-void mmDBPrintThisStack(void* memblock, int all, int free);
+void mmPrintStack(FILE *fd, unsigned long *stack, int mm);
+void mmDBPrintStack(FILE *fd, void* memblock, int mm);
+void mmDBPrintStackFrames(FILE *fd, void* memblock, int start, int end);
+void mmPrintStackFrames(FILE *fd, unsigned long *bt_stack, int start, int end, int mm); 
+void mmDBPrintThisStack(FILE *fd, void* memblock, int all, int free);
 #endif /* linux, i386 */
 #endif /* not optimize */
Index: Singular/mmcheck.c
===================================================================
--- Singular/mmcheck.c	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/mmcheck.c	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mmcheck.c,v 1.13 1999-10-19 14:55:38 obachman Exp $ */
+/* $Id: mmcheck.c,v 1.14 1999-10-22 09:07:04 obachman Exp $ */
 
 /*
@@ -129,5 +129,5 @@
                  what->allocated_fname, what->freed_lineno );
 #ifdef MTRACK
-  mmDBPrintThisStack(what, MM_PRINT_ALL_STACK, 0);
+  mmDBPrintThisStack(stderr, what, MM_PRINT_ALL_STACK, 0);
 #endif
 
Index: Singular/mmemory.h
===================================================================
--- Singular/mmemory.h	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/mmemory.h	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -4,9 +4,10 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mmemory.h,v 1.26 1999-10-19 14:55:39 obachman Exp $ */
+/* $Id: mmemory.h,v 1.27 1999-10-22 09:07:05 obachman Exp $ */
 /*
 * ABSTRACT
 */
 #include <stdlib.h>
+#include <stdio.h>
 
 #ifdef __cplusplus
@@ -172,5 +173,5 @@
 void mmStartReferenceWatch();
 void mmStopReferenceWatch();
-void mmTestList (int all);
+void mmTestList(FILE *fd, int all);
 
 #else
Index: Singular/mmisc.c
===================================================================
--- Singular/mmisc.c	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/mmisc.c	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mmisc.c,v 1.18 1999-10-19 14:55:39 obachman Exp $ */
+/* $Id: mmisc.c,v 1.19 1999-10-22 09:07:05 obachman Exp $ */
 
 /*
@@ -364,18 +364,18 @@
 
 #ifdef MLIST
-void mmTestList (int all)
+void mmTestList (FILE *fd, int all)
 {
   DBMCB * what=mm_theDBused.next;
-  fprintf(stderr,"list of used blocks:\n");
+  fprintf(fd,"list of used blocks:\n");
   while (what!=NULL)
   {
     if ((all & MM_PRINT_ALL_ADDR) || ! (what->flags & MM_INITFLAG))
     {
-      fprintf( stderr, "%d bytes at %p allocated in: %s:%d",
+      fprintf( fd, "%d bytes at %p allocated in: %s:%d",
                (int)what->size, what, what->allocated_fname, what->allocated_lineno);
 #ifdef MTRACK
-      mmDBPrintStack(what, all);
+      mmDBPrintStack(fd, what, all);
 #else
-      fprintf( stderr, "\n");
+      fprintf( fd, "\n");
 #endif
     }
Index: Singular/polys-comp.h
===================================================================
--- Singular/polys-comp.h	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/polys-comp.h	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: polys-comp.h,v 1.15 1999-10-19 12:42:46 obachman Exp $ */
+/* $Id: polys-comp.h,v 1.16 1999-10-22 09:07:05 obachman Exp $ */
 
 /***************************************************************
@@ -14,5 +14,7 @@
 
 #include "polys-impl.h"
-#include "syz.h"
+
+// need to undefine this, since longs might be negative
+#define unsigned
 
 #ifdef WORDS_BIGENDIAN
@@ -94,4 +96,6 @@
 }
 
+#define unsigned unsigned
+
 #endif // POLYS_COMP_H
 
Index: Singular/scanner.l
===================================================================
--- Singular/scanner.l	(revision 37c5b38924d40017b1e773d5675c259d1e72f3c4)
+++ Singular/scanner.l	(revision 5c187b084d30061e160686b61463bcc0f62b726d)
@@ -3,5 +3,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: scanner.l,v 1.22 1999-10-14 14:27:29 obachman Exp $ */
+/* $Id: scanner.l,v 1.23 1999-10-22 09:07:06 obachman Exp $ */
 #include <stdio.h>
 #include <string.h>
@@ -276,5 +276,5 @@
                            #ifdef MDEBUG
                              #ifdef MLIST
-                             mmTestList(0);
+                             mmTestList(stdout, 0);
                              #endif
                            #endif
