Changeset 75f460 in git for Singular/run.c


Ignore:
Timestamp:
Dec 16, 2014, 3:43:21 PM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
fce947c9e6c3e8c6d5a622c7f6b0d724580993cc
Parents:
a2e4470c6e9a666de8ab7b706370c15e13092f76
Message:
format
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/run.c

    ra2e447 r75f460  
    2020 * This program is based on the runemacs.c distributed with XEmacs 21.0
    2121 *
    22  * Simple program to start gnu-win32 X11 programs (and native XEmacs) 
     22 * Simple program to start gnu-win32 X11 programs (and native XEmacs)
    2323 * with its console window hidden.
    2424 *
    2525 * This program is provided purely for convenience, since most users will
    2626 * use XEmacs in windowing (GUI) mode, and will not want to have an extra
    27  * console window lying around. Ditto for desktop shortcuts to gnu-win32 
     27 * console window lying around. Ditto for desktop shortcuts to gnu-win32
    2828 * X11 executables.
    2929 */
     
    170170           ((p2 = strrchr(p, '/')) && stricmp(p2, "/bin") == 0) )
    171171      {
    172          *p2 = '\0';   
     172         *p2 = '\0';
    173173#if defined(__CYGWIN__)
    174174         CYGWIN_CONV_TO_POSIX_PATH((exec2,tmp));
     
    202202   if (char_cnt > MAX_ARGS*MAX_PATH) /* then we ran out of room */
    203203      error("command line too long -\n%s",new_cmdline);
    204    
     204
    205205   strcpy(new_cmdline,exec);
    206206   for (i = first_arg; i < argc; i++)
     
    229229 *  5) convert to cygwin-style path to resolve symlinks within the pathspec
    230230 *  6) check filename: if it's a symlink, resolve it by peeking inside
    231  *  7) convert to win32-style path+filename since we're using Windows 
     231 *  7) convert to win32-style path+filename since we're using Windows
    232232 *       createProcess() to launch
    233233 */
     
    242242
    243243   int len = 0;
    244    /* 
    245     * STARTS WITH / or \ 
     244   /*
     245    * STARTS WITH / or \
    246246    * execpath NOT used
    247247    */
     
    250250#if defined(__CYGWIN__)
    251251      strcpy(exec_tmp,execname);
    252 #else   
     252#else
    253253      exec_tmp[0] = ((char) (_getdrive() + ((int) 'A') - 1));
    254254      exec_tmp[1] = ':';
     
    268268      Trace((exec_tmp2));
    269269   }
    270    /* 
     270   /*
    271271    * STARTS WITH x:\ or x:/
    272272    * execpath NOT used
     
    276276       ((execname[2] == '\\') || (execname[2] == '/')))
    277277   {
    278       strcpy(exec_tmp,execname);       
     278      strcpy(exec_tmp,execname);
    279279      Trace(("x: -\nexec_tmp\t%s\nexecname\t%s\nexecpath\t%s\n",
    280280             exec_tmp,execname,execpath));
     
    289289      Trace((exec_tmp2));
    290290   }
    291    /* 
     291   /*
    292292    * STARTS WITH ./ or .\
    293293    */
     
    321321      orig_pathlist = getenv("PATH");
    322322      if ((pathlist = malloc (strlen(orig_pathlist)
    323                               + strlen(".") 
     323                              + strlen(".")
    324324                              + strlen(execpath)+ 3)) == NULL)
    325325         error("internal error - out of memory");
     
    369369      CYGWIN_CONV_TO_POSIX_PATH((exec_tmp,sym_link_name));
    370370      Trace((sym_link_name));
    371      
     371
    372372      if (lstat(sym_link_name, &stbuf) == 0)
    373373      {
     
    378378            else
    379379            {
    380                 // if realname starts with '/' it's a rootpath 
     380                // if realname starts with '/' it's a rootpath
    381381                if (real_name[0] == '/')
    382382                    strcpy(exec_tmp2,real_name);
     
    397397   }
    398398   CYGWIN_CONV_TO_FULL_WIN32_PATH((exec_tmp2,exec));
    399 #else                                   
     399#else
    400400   strcpy (exec, exec_tmp2);
    401 #endif 
     401#endif
    402402}
    403403int endsWith(const char* s1, const char* s2)
     
    510510 *   additionally, backslash escapes next character, even if that
    511511 *   next character is a delimiter. Or a double quote.
    512  *   WARNING: this means that backslash may NOT be a delimiter 
     512 *   WARNING: this means that backslash may NOT be a delimiter
    513513 */
    514514char* my_strtok(char* s, const char* delim, char** lasts)
     
    517517   int c, sc;
    518518   char *tok;
    519    
     519
    520520   if ((s == NULL) && ((s = *lasts) == NULL))
    521521      return NULL;
     
    562562         c = *s++; /* otherwise, skip the escaped character */
    563563      }
    564 #endif   
     564#endif
    565565      spanp = (char *)delim;
    566566      do {
     
    628628    char *recursive_name;
    629629    int foundit = FALSE;
    630    
     630
    631631    returnval[0] = '\0';
    632632
     
    652652    return retval;
    653653}
    654 int fileExistsMulti(char* fullname, const char* path, 
     654int fileExistsMulti(char* fullname, const char* path,
    655655                    const char* name_noext, const char* exts[],
    656656                    const int extcnt)
     
    689689   else
    690690      work[0]='\0';
    691    
     691
    692692   strcat(work, name);
    693693#if defined(__CYGWIN__)
    694    CYGWIN_CONV_TO_POSIX_PATH((work, work2)); 
     694   CYGWIN_CONV_TO_POSIX_PATH((work, work2));
    695695#else
    696696   strcpy(work2,work);
Note: See TracChangeset for help on using the changeset viewer.