Changeset ef0124 in git for Singular/feResource.cc


Ignore:
Timestamp:
May 5, 2000, 8:40:34 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
ba9453910d26fdb676fa083bc02d866111ea5ece
Parents:
f9bfec9b7263804ac776257b32087185168b1000
Message:
*** empty log message ***


git-svn-id: file:///usr/local/Singular/svn/trunk@4290 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/feResource.cc

    rf9bfec ref0124  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: feResource.cc,v 1.23 2000-04-27 10:07:06 obachman Exp $ */
     4/* $Id: feResource.cc,v 1.24 2000-05-05 18:40:28 obachman Exp $ */
    55/*
    66* ABSTRACT: management of resources
     
    1111#include "mod2.h"
    1212#include "distrib.h"
    13 #ifndef ESINGULAR
     13#if !defined(ESINGULAR) && !defined(TSINGULAR)
    1414#include "mmemory.h"
    1515#include "febase.h"
     
    2121
    2222#if defined(MAKE_DISTRIBUTION)
    23 #if defined(WINNT)
     23#if defined(WINNT) && ! defined(__CYGWIN__)
    2424#define SINGULAR_DEFAULT_DIR "/Singular/"S_VERSION1
    2525#elif defined(macintosh)
     
    8080  {"info",      'I',    feResBinary,"INFO",                 "%b/info",              ""},
    8181  {"tkinfo",    'T',    feResBinary,"TKINFO",               "%b/tkinfo",            ""},
     82#ifdef WINNT
     83  {"rxvt",     'X',    feResBinary,"RXVT",                "%b/rxvt",             ""},
     84#else
    8285  {"xterm",     'X',    feResBinary,"XTERM",                "%b/xterm",             ""},
     86#endif
    8387  {"Path",      'p',    feResPath,  NULL,                   "%b;$PATH",         ""},
    8488#endif // ! defined(macintosh)
     
    9094  {"EmacsLoad",'l',    feResFile,   "ESINGULAR_EMACS_LOAD",  "%e/.emacs-singular",             ""},
    9195  {"EmacsDir",  'e',    feResDir,   "ESINGULAR_EMACS_DIR",   "%r/emacs",             ""},
     96#elif defined(TSINGULAR)
     97  {"SingularXterm",'M',feResBinary, "TSINGULAR_SINGULAR",    "%b/Singular",           ""},
    9298#else
    9399  {"EmacsDir",  'e',    feResDir,   "SINGULAR_EMACS_DIR",   "%r/emacs",             ""},
     
    254260static char* feResourceDefault(feResourceConfig config)
    255261{
     262  if (config == NULL) return NULL;
    256263  char* value = (char*) AllocL(MAXRESOURCELEN);
    257264  feSprintf(value, config->fmt, -1);
     
    299306    if (executable != NULL)
    300307    {
     308#ifdef RESOURCE_DEBUG
     309      printf("exec:%s\n", executable);
     310#endif
    301311      strcpy(value, executable);
     312#ifdef RESOURCE_DEBUG
     313      printf("value:%s\n", value);
     314#endif
    302315      FreeL(executable);
    303316    }
     
    317330    }
    318331  }
     332
     333#ifdef RESOURCE_DEBUG
     334      printf("value:%s\n", value);
     335#endif
    319336
    320337  if (*value == '\0' && config->fmt != NULL )
     
    401418  char* executable = find_executable(feArgv0);
    402419#ifdef RESOURCE_DEBUG
    403   printf("feGetExpandedExecutable: find_exec exited with =%s=\n", executable);
     420  printf("feGetExpandedExecutable: find_exec exited with =%s=%d\n", executable, access(executable, X_OK));
    404421#endif
    405422  if (executable == NULL)
     
    421438#ifdef RESOURCE_DEBUG
    422439  printf("feVerifyResourceValue: entering with =%s=\n", value);
     440  printf("%d:%d\n", access(value, R_OK), access(value, X_OK));
    423441#endif
    424442  switch(type)
     
    449467{
    450468  if (value == NULL || *value == '\0') return value;
     469#ifdef RESOURCE_DEBUG
     470      printf("Clean value:%s\n", value);
     471#endif
    451472#ifdef WINNT
     473#ifdef RESOURCE_DEBUG
     474      printf("Clean WINNT value:%s\n", value);
     475#endif
    452476  if (type == feResBinary)
    453477  {
    454478    int l = strlen(value);
    455     if (l < 4 || strcmp(&value[l-4], ".exe") != 0)
     479    if (l < 4 || (strcmp(&value[l-4], ".exe") != 0 &&
     480                  strcmp(&value[l-4], ".EXE") != 0))
    456481      strcat(value, ".exe");
    457482  }
Note: See TracChangeset for help on using the changeset viewer.