Changeset d03091c
- Timestamp:
- Nov 1, 2006, 12:59:52 AM (18 years ago)
- 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)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
rf72f573 rd03091c 108 108 } 109 109 configfile=argv[1]; 110 abort(); /*We dirty hackers have broken -c for now--hartmans*/ 110 111 argv+=2; 111 112 argc-=2; … … 311 312 owl_function_debugmsg("startup: processing config file"); 312 313 owl_context_set_readconfig(owl_global_get_context(&g)); 313 perlerr=owl_perlconfig_readconfig( configfile);314 perlerr=owl_perlconfig_readconfig(); 314 315 if (perlerr) { 315 316 endwin(); -
perlconfig.c
rf72f573 rd03091c 162 162 } 163 163 164 char *owl_perlconfig_readconfig( char *file)165 { 166 int ret , fd;164 char *owl_perlconfig_readconfig(void) 165 { 166 int ret; 167 167 PerlInterpreter *p; 168 char filename[1024];169 char *embedding[5];170 168 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 181 171 182 172 /* create and initialize interpreter */ … … 187 177 owl_global_set_no_have_config(&g); 188 178 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); 212 181 if (ret || SvTRUE(ERRSV)) { 213 182 STRLEN n_a; -
perlwrap.pm
r8862725 rd03091c 17 17 use lib($::ENV{'HOME'}."/.owl/lib"); 18 18 19 20 our $configfile = $::ENV{'HOME'}."/.owlconf"; 19 21 20 22 # populate global variable space for legacy owlconf files … … 283 285 package main; 284 286 287 # load the config file 288 if (-r $owl::configfile) { 289 do $owl::configfile or die $@; 290 } 291 285 292 1;
Note: See TracChangeset
for help on using the changeset viewer.