Changeset d03091c


Ignore:
Timestamp:
Nov 1, 2006, 12:59:52 AM (17 years ago)
Author:
Sam Hartman <hartmans@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
38ffdf9
Parents:
8862725
git-author:
Sam Hartman <hartmans@mit.edu> (10/31/06 23:53:05)
git-committer:
Sam Hartman <hartmans@mit.edu> (11/01/06 00:59:52)
Message:
Reorder configuration handling so that perlwrap.m is pulled in before   .owlconf.
Initialize perl *always* even without owlconf.
Disable -c command line argument
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    rf72f573 rd03091c  
    108108      }
    109109      configfile=argv[1];
     110      abort(); /*We dirty hackers have broken -c for now--hartmans*/
    110111      argv+=2;
    111112      argc-=2;
     
    311312  owl_function_debugmsg("startup: processing config file");
    312313  owl_context_set_readconfig(owl_global_get_context(&g));
    313   perlerr=owl_perlconfig_readconfig(configfile);
     314  perlerr=owl_perlconfig_readconfig();
    314315  if (perlerr) {
    315316    endwin();
  • perlconfig.c

    rf72f573 rd03091c  
    162162}
    163163
    164 char *owl_perlconfig_readconfig(char *file)
    165 {
    166   int ret, fd;
     164char *owl_perlconfig_readconfig(void)
     165{
     166  int ret;
    167167  PerlInterpreter *p;
    168   char filename[1024];
    169   char *embedding[5];
    170168  char *err;
    171   struct stat statbuff;
    172 
    173   if (file==NULL) {
    174     sprintf(filename, "%s/%s", getenv("HOME"), ".owlconf");
    175   } else {
    176     strcpy(filename, file);
    177   }
    178   embedding[0]="";
    179   embedding[1]=filename;
    180   embedding[2]=0;
     169  char *args[4] = {"", "-e", "0;", NULL};
     170
    181171
    182172  /* create and initialize interpreter */
     
    187177  owl_global_set_no_have_config(&g);
    188178
    189   /* Before we let perl have at it, we'll do our own checks on the the
    190    *  file to see if it's present, readnable etc.
    191    */
    192 
    193   /* Not present, start without it */
    194   ret=stat(filename, &statbuff);
    195   if (ret) {
    196     return(NULL);
    197   }
    198 
    199   /* present, but stat thinks it's unreadable */
    200   if (! (statbuff.st_mode & S_IREAD)) {
    201     return(owl_sprintf("%s present but not readable", filename));
    202   }
    203 
    204   /* can we open it? */
    205   fd=open(filename, O_RDONLY);
    206   if (fd==-1) {
    207     return(owl_sprintf("could not open %s for reading", filename));
    208   }
    209   close(fd);
    210 
    211   ret=perl_parse(p, owl_perl_xs_init, 2, embedding, NULL);
     179
     180  ret=perl_parse(p, owl_perl_xs_init, 2, args, NULL);
    212181  if (ret || SvTRUE(ERRSV)) {
    213182    STRLEN n_a;
  • perlwrap.pm

    r8862725 rd03091c  
    1717use lib($::ENV{'HOME'}."/.owl/lib");
    1818
     19
     20our $configfile = $::ENV{'HOME'}."/.owlconf";
    1921
    2022# populate global variable space for legacy owlconf files
     
    283285package main;
    284286
     287# load the config  file
     288if (-r $owl::configfile) {
     289do $owl::configfile or die $@;
     290}
     291
    2852921;
Note: See TracChangeset for help on using the changeset viewer.