Changeset d03091c for perlconfig.c


Ignore:
Timestamp:
Nov 1, 2006, 12:59:52 AM (14 years ago)
Author:
Sam Hartman <hartmans@mit.edu>
Branches:
master, barnowl_perlaim, debian, 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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.