[352] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r497 - in trunk: . owl

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:05:14 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Mon,  8 Jan 2007 18:50:12 -0500 (EST)

Author: nelhage
Date: 2007-01-08 18:50:12 -0500 (Mon, 08 Jan 2007)
New Revision: 497

Modified:
   trunk/
   trunk/owl/owl.c
   trunk/owl/perlconfig.c
   trunk/owl/perlwrap.pm
Log:
 r17876@phanatique:  nelhage | 2007-01-08 18:50:09 -0500
 Bring back the -c option, and no longer choke if .owlconf doesn't
 return true.



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - bb873fd7-8e23-0410-944a-99ec44c633eb:/branches/owl/filter-rewrite:15925
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h/trunk:17874
   + bb873fd7-8e23-0410-944a-99ec44c633eb:/branches/owl/filter-rewrite:15925
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h/trunk:17876

Modified: trunk/owl/owl.c
===================================================================
--- trunk/owl/owl.c	2007-01-08 22:08:55 UTC (rev 496)
+++ trunk/owl/owl.c	2007-01-08 23:50:12 UTC (rev 497)
@@ -107,7 +107,6 @@
 	exit(1);
       }
       configfile=argv[1];
-      abort(); /*We dirty hackers have broken -c for now--hartmans*/
       argv+=2;
       argc-=2;
     } else if (!strcmp(argv[0], "-t")) {
@@ -304,7 +303,7 @@
   /* read the config file */
   owl_function_debugmsg("startup: processing config file");
   owl_context_set_readconfig(owl_global_get_context(&g));
-  perlerr=owl_perlconfig_readconfig();
+  perlerr=owl_perlconfig_readconfig(configfile);
   if (perlerr) {
     endwin();
     owl_function_error("Error parsing configfile: %s\n", perlerr);

Modified: trunk/owl/perlconfig.c
===================================================================
--- trunk/owl/perlconfig.c	2007-01-08 22:08:55 UTC (rev 496)
+++ trunk/owl/perlconfig.c	2007-01-08 23:50:12 UTC (rev 497)
@@ -219,7 +219,7 @@
 }
 
 
-char *owl_perlconfig_readconfig(void)
+char *owl_perlconfig_readconfig(char * file)
 {
   int ret;
   PerlInterpreter *p;
@@ -266,7 +266,12 @@
   perl_get_sv("owl::time", TRUE);
   perl_get_sv("owl::host", TRUE);
   perl_get_av("owl::fields", TRUE);
-  
+
+  if(file) {
+    SV * cfg = get_sv("owl::configfile", TRUE);
+    sv_setpv(cfg, file);
+  }
+
   perl_eval_pv(owl_perlwrap_codebuff, FALSE);
 
   if (SvTRUE(ERRSV)) {

Modified: trunk/owl/perlwrap.pm
===================================================================
--- trunk/owl/perlwrap.pm	2007-01-08 22:08:55 UTC (rev 496)
+++ trunk/owl/perlwrap.pm	2007-01-08 23:50:12 UTC (rev 497)
@@ -17,8 +17,10 @@
 use lib($::ENV{'HOME'}."/.owl/lib");
 
 
-our $configfile = $::ENV{'HOME'}."/.owlconf";
+our $configfile;
 
+$configfile ||= $::ENV{'HOME'}."/.owlconf";
+
 # populate global variable space for legacy owlconf files 
 sub _format_msg_legacy_wrap {
     my ($m) = @_;
@@ -454,7 +456,11 @@
 
 # load the config  file
 if (-r $owl::configfile) {
-do $owl::configfile or die $@;
+    undef $!;
+    undef $@;
+    do $owl::configfile;
+    die $@ if $@;
+    die $! if $!;
 }
 
 1;


home help back first fref pref prev next nref lref last post