Changeset a00aa7 in git for Singular/extra.cc


Ignore:
Timestamp:
Nov 10, 2021, 2:54:38 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
8ad2935b9f03ca7820942e4018d26497779d34e5
Parents:
314f6db51fc43d6de9f441fe21423a1b4513303d
Message:
move setting PATH to system("sh",..)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r314f6db ra00aa7  
    1414#include "misc/sirandom.h"
    1515#include "resources/omFindExec.h"
     16
     17#ifdef AIX_4
     18#ifndef HAVE_PUTENV
     19#define HAVE_PUTENV 1
     20#endif
     21#endif
     22
     23#if defined(HPUX_10) || defined(HPUX_9)
     24#ifndef HAVE_SETENV
     25extern "C" int setenv(const char *name, const char *value, int overwrite);
     26#endif
     27#endif
    1628
    1729#ifdef HAVE_CCLUSTER
     
    481493        return TRUE;
    482494      }
     495      #if defined(HAVE_SETENV) || defined(HAVE_PUTENV)
     496      char* path = feResource('p');
     497      char *oldpath= getenv("PATH");
     498      if (oldpath!=NULL) oldpath=omStrDup(oldpath);
     499      #ifdef HAVE_PUTENV
     500      if (path != NULL)
     501      {
     502        char *s=(char *)malloc(strlen(path)+6);
     503                      sprintf(s,"PATH=%s",path);
     504                      putenv(s);
     505      }
     506      #else
     507      if (path != NULL) setenv("PATH", path, 1);
     508      #endif
     509      #endif
     510
    483511      res->rtyp=INT_CMD;
    484512      if (h==NULL) res->data = (void *)(long) system("sh");
     
    487515      else
    488516        WerrorS("string expected");
     517
     518      #if defined(HAVE_SETENV) || defined(HAVE_PUTENV)
     519      #ifdef HAVE_PUTENV
     520      if (oldpath != NULL)
     521      {
     522        char *s=(char *)malloc(strlen(oldpath)+6);
     523                      sprintf(s,"PATH=%s",oldpath);
     524                      putenv(s);
     525                      omFree(oldpath);
     526      }
     527      #else
     528      if (oldpath != NULL)
     529      {
     530        setenv("PATH", oldpath, 1);
     531        omFree(oldpath);
     532      }
     533      #endif
     534      #endif
    489535      return FALSE;
    490536    }
     
    32353281          if (strcmp(s,"FLINT_P")==0) { if (d) On(SW_USE_FL_GCD_P); else Off(SW_USE_FL_GCD_P); } else
    32363282          if (strcmp(s,"FLINT_0")==0) { if (d) On(SW_USE_FL_GCD_0); else Off(SW_USE_FL_GCD_0); } else
    3237         #endif 
     3283        #endif
    32383284          if (strcmp(s,"EZGCD")==0) { if (d) On(SW_USE_EZGCD); else Off(SW_USE_EZGCD); } else
    32393285          if (strcmp(s,"EZGCD_P")==0) { if (d) On(SW_USE_EZGCD_P); else Off(SW_USE_EZGCD_P); } else
     
    37403786    if(strcmp(sys_cmd,"ccluster")==0)
    37413787    {
    3742       if ((currRing!=NULL) 
     3788      if ((currRing!=NULL)
    37433789      && (rField_is_Q(currRing) || rField_is_R(currRing) || rField_is_long_R(currRing)))
    37443790      {
Note: See TracChangeset for help on using the changeset viewer.