Changeset d9e190 in git for libpolys/resources


Ignore:
Timestamp:
Apr 21, 2011, 4:41:50 PM (13 years ago)
Author:
Mohamed Barakat <mohamed.barakat@…>
Branches:
(u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
Children:
6d28ba7962ff547926c1a0ce553ff7070a77746e
Parents:
4f07ef5931598da3a05c62cb735d25ecaac0c5a9
git-author:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-04-21 16:41:50+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:27+01:00
Message:
got rid of program_invocation_name (non-portable) and replaced it by an educated guess
changed the test generation script to save a copy of the program name in main
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/resources/feResource.cc

    r4f07ef rd9e190  
    1010#include <unistd.h>
    1111#include <string.h>
     12#include <unistd.h>
     13#include <sys/param.h>
    1214
    1315#include "config.h"
     
    1517
    1618#include "feResource.h"
    17 
    18 
    19 // the following is needed due to 'program_invocation_name'
    20 #define _GNU_SOURCE
    21 #include <errno.h>
    2219
    2320
     
    179176void feInitResources(char* argv0)
    180177{
    181   if (argv0==NULL)
    182   {
    183     argv0 = program_invocation_name;
    184   }
    185  
    186178#if defined(ix86_Win) && defined(__GNUC__)
    187179  if (cygwin32_posix_path_list_p (getenv("PATH")))
    188180    fePathSep = ':';
    189181#endif
    190   feArgv0 = omStrDup(argv0);
    191 #ifdef RESOURCE_DEBUG
    192   printf("feInitResources: entering with argv0=%s=\n", argv0);
     182  if (argv0==NULL)
     183  {
     184    feArgv0 = (char*)omAlloc0(MAXPATHLEN+strlen("/Singular"));
     185    getcwd(feArgv0,MAXPATHLEN);
     186    strcpy(feArgv0+strlen(feArgv0),"/Singular");
     187  }
     188  else
     189    feArgv0 = omStrDup(argv0);
     190#ifdef RESOURCE_DEBUG
     191  printf("feInitResources: entering with argv0=%s=\n", feArgv0);
    193192#endif
    194193  // init some Resources
Note: See TracChangeset for help on using the changeset viewer.