[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323

Bernhard R. Link brlink at debian.org
Tue Apr 24 15:53:44 UTC 2012


The following commit has been merged in the cleanedupstream branch:
commit 52d59db073ec5058c177e2ee009eb5910d202061
Author: Hans Schoenemann <hannes at mathematik.uni-kl.de>
Date:   Fri Feb 24 18:39:23 2012 +0100

    fix: better check for adding package to Top (enterid)

diff --git a/Singular/ipid.cc b/Singular/ipid.cc
index 49d8f57..3af0d2b 100644
--- a/Singular/ipid.cc
+++ b/Singular/ipid.cc
@@ -234,7 +234,15 @@ idhdl enterid(const char * s, int lev, int t, idhdl* root, BOOLEAN init, BOOLEAN
   idhdl h;
   s=omStrDup(s);
   idhdl *save_root=root;
-  if (t==PACKAGE_CMD) root=&(basePack->idroot);
+  BOOLEAN to_reset;
+  if (t==PACKAGE_CMD)
+  {
+    if (root!=&(basePack->idroot))
+    {
+      root=&(basePack->idroot);
+      to_reset=TRUE;
+    }
+  }
   // is it already defined in root ?
   if ((h=(*root)->get(s,lev))!=NULL)
   {
@@ -298,7 +306,7 @@ idhdl enterid(const char * s, int lev, int t, idhdl* root, BOOLEAN init, BOOLEAN
 #ifndef NDEBUG
   checkall();
 #endif
-  if (t==PACKAGE_CMD) root=save_root;
+  if (to_reset) root=save_root;
   return *root;
 
   errlabel:
@@ -306,7 +314,7 @@ idhdl enterid(const char * s, int lev, int t, idhdl* root, BOOLEAN init, BOOLEAN
     Werror("identifier `%s` in use",s);
     //listall();
     omFree((ADDRESS)s);
-    if (t==PACKAGE_CMD) root=save_root;
+    if (to_reset) root=save_root;
     return NULL;
 }
 void killid(const char * id, idhdl * ih)

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list