pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   // -*- Pike -*-   //   // Master Control Program for Pike.   //   // This file is part of Pike. For copyright information see COPYRIGHT.   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information.   // - // $Id: master.pike.in,v 1.357 2006/02/20 11:44:10 nilsson Exp $ + // $Id: master.pike.in,v 1.358 2006/10/19 15:30:46 grubba Exp $      #pike __REAL_VERSION__   //#pragma strict_types      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif   
pike.git/lib/master.pike.in:2645:    stringp(err[0])?err[0]:describe_backtrace(err) );       argv[0] = search(programs, prog) || argv[0];    } else {    argv[0]=combine_path_with_cwd(argv[0]);       mixed err = catch {    prog=(program)argv[0];    };    -  if (err) +  if (err) { +  if( !file_stat(argv[0]) ) { +  werror("Could not find file %O. %s.\n", argv[0], strerror(errno())); +  exit(1); +  } +  if( !file_stat(argv[0])->isreg ) { +  werror("File %O is not a regular file.\n", argv[0]); +  exit(1); +  } +  if( !master_read_file(argv[0]) ) { +  werror("File %O is not readable. %s.\n", argv[0], strerror(errno())); +  exit(1); +  }    error( "Pike: Failed to compile script:\n"    "%s\n", stringp(err[0])?err[0]:describe_backtrace(err) );    } -  +  }       if(!prog)    error("Pike: Couldn't find script to execute\n(%O)\n", argv[0]);      #if constant(_debug)    if(debug) _debug(debug);   #endif    if(trace) trace = predef::trace(trace);    mixed ret;    mixed err = catch {