Changeset ced25d1


Ignore:
Timestamp:
Feb 21, 2003, 10:31:16 AM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
2c8d62e
Parents:
060b3b4
Message:
In the zlist function, give a more detailed error message if
  the file cannot be opened.
Renamed old instances of zsig_exec in the code to zsigproc
Don't print the stderr from zsigproc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r060b3b4 rced25d1  
    1919          'none' filter defined as 'false'
    2020        Fixed bug in 'unsub' command that could cause file corruption
     21        In the zlist function, give a more detailed error message if
     22          the file cannot be opened.
     23        Renamed old instances of zsig_exec in the code to zsigproc
     24        Don't print the stderr from zsigproc
    2125
    22261.2.8
  • functions.c

    r060b3b4 rced25d1  
    24542454  f=fopen(ourfile, "r");
    24552455  if (!f) {
    2456     owl_function_makemsg("Error opening file %s", ourfile);
     2456    owl_function_makemsg("Error opening file %s: %s",
     2457                         ourfile,
     2458                         strerror(errno) ? strerror(errno) : "");
    24572459    return;
    24582460  }
  • owl.c

    r89426ab rced25d1  
    3030  owl_editwin *tw;
    3131  owl_popwin *pw;
    32   int j, ret, initialsubs, debug, newzephyrs, argcsave, followlast, nexttimediff;
     32  int j, ret, initialsubs, debug, argcsave, followlast;
     33  int newzephyrs, zpendcount, nexttimediff;
    3334  struct sigaction sigact;
    3435  char *configfile, *tty, *perlout, **argvsave, buff[LINE], startupmsg[LINE];
     
    127128  owl_context_set_readconfig(owl_global_get_context(&g));
    128129
     130  /* set the tty, either from the command line, or by figuring it out */
    129131  if (tty) {
    130132    owl_global_set_tty(&g, tty);
     
    180182    exit(1);
    181183  }
     184
     185  /* execute the startup function in the configfile */
    182186  perlout = owl_config_execute("owl::startup();");
    183187  if (perlout) owl_free(perlout);
     
    220224  strcat(startupmsg, "Please report any bugs or suggestions to bug-owl@mit.edu          (   )  \n");
    221225  strcat(startupmsg, "-------------------------------------------------------------------m-m---\n");
    222  
    223226  owl_function_adminmsg("", startupmsg);
    224227  sepbar(NULL);
     
    260263    /* grab incoming zephyrs */
    261264    newzephyrs=0;
     265    zpendcount=0;
    262266    while(ZPending()) {
    263267      ZNotice_t notice;
     
    265269      owl_message *m;
    266270
     271      /* grab a notice, but if we've done 20 without stopping, take
     272         a break to process keystrokes etc. */
     273      if (zpendcount>20) break;
    267274      ZReceiveNotice(&notice, &from);
     275      zpendcount++;
    268276
    269277      /* is this an ack from a zephyr we sent? */
     
    330338    }
    331339
    332     /* check if newmsgproc is active, if not but the option is on,
    333        make it active */
     340    /* do the newmsgproc thing */
    334341    if (newzephyrs) {
    335342      owl_function_do_newmsgproc();
     
    337344   
    338345    /* redisplay if necessary */
     346    /* maybe this should be optimized to not even run if
     347       the zephyr won't be displayed */
    339348    if (newzephyrs) {
    340349      owl_mainwin_redisplay(owl_global_get_mainwin(&g));
  • variable.c

    r7e3e00a rced25d1  
    150150               "This file will be logged to if 'debug' is set to 'on'.\n"),
    151151 
    152   OWLVAR_PATH( "zsigproc" /* %OwlVarStub:zsig_exec */, NULL,
     152  OWLVAR_PATH( "zsigproc" /* %OwlVarStub:zsigproc */, NULL,
    153153               "name of a program to run that will generate zsigs",
    154154               "This program should produce a zsig on stdout when run.\n"
  • zwrite.c

    re3869df rced25d1  
    2222  int argc, badargs, myargc;
    2323  char **argv, **myargv;
    24   char *zsigexec, *zsigowlvar, *zsigzvar, *ptr;
     24  char *zsigproc, *zsigowlvar, *zsigzvar, *ptr;
    2525  struct passwd *pw;
    2626
     
    112112
    113113  /* set a zsig */
    114   zsigexec = owl_global_get_zsig_exec(&g);
     114  zsigproc = owl_global_get_zsigproc(&g);
    115115  zsigowlvar = owl_global_get_zsig(&g);
    116116  zsigzvar = ZGetVariable("zwrite-signature");
     
    119119    owl_free(z->zsig);
    120120    z->zsig=strdup(zsigowlvar);
    121   } else if (zsigexec && *zsigexec) {
     121  } else if (zsigproc && *zsigproc) {
    122122    FILE *file;
    123     char buff[LINE];
    124 
    125     file=popen(zsigexec, "r");
     123    char buff[LINE], *openline;
     124
     125    /* simple hack for now to nuke stderr */
     126    openline=owl_malloc(strlen(zsigproc)+40);
     127    strcpy(openline, zsigproc);
     128    strcat(openline, " 2> /dev/null");
     129    file=popen(openline, "r");
     130    owl_free(openline);
    126131    if (!file) {
    127132      if (zsigzvar && *zsigzvar) {
Note: See TracChangeset for help on using the changeset viewer.