Changeset 990772c


Ignore:
Timestamp:
Nov 17, 2013, 3:44:13 AM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
release-1.9
Children:
14515f6
Parents:
1cefe5f
git-author:
David Benjamin <davidben@mit.edu> (01/10/13 14:29:33)
git-committer:
Anders Kaseorg <andersk@mit.edu> (11/17/13 03:44:13)
Message:
Make :loadsubs reload instanced personals too

Right now if your subs get lost because something falls over, you have
to manually sub to instanced personals to get them back. :loadsubs
doesn't work.

(Supposedly that code is for "backwards compatibility", but... it dates
back to kretch. Probably because it's odd that :loadsubs [file] will
also automatically load the default subs. But given that everyone runs
:loadsubs with no argument to mean "oops zephyr fell over reload my subs
please", I'm okay with adding more code to the "backwards compatibility"
path. I doubt anyone actually runs :loadsubs with an argument anyway.)

Also, while I'm here, get rid of that 'foo' variable. (Really? Really?!
foo?!?)

(cherry picked from commit 05adccf169f26130f56cd69a12829a9d80043a75)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r06470d7 r990772c  
    871871void owl_function_loadsubs(const char *file)
    872872{
    873   int ret, ret2;
    874   const char *foo;
     873  int ret, ret2, ret3;
    875874  char *path;
    876875
     
    884883
    885884  /* for backwards compatibility for now */
    886   ret2=owl_zephyr_loaddefaultsubs();
     885  ret2 = owl_zephyr_loaddefaultsubs();
     886  ret3 = owl_zephyr_loadbarnowldefaultsubs();
    887887
    888888  if (!owl_context_is_interactive(owl_global_get_context(&g))) return;
    889889
    890   foo=file?file:"file";
    891   if (ret==0 && ret2==0) {
     890  if (ret == 0 && ret2 == 0 && ret3 == 0) {
    892891    if (!file) {
    893892      owl_function_makemsg("Subscribed to messages.");
     
    895894      owl_function_makemsg("Subscribed to messages from %s", file);
    896895    }
    897   } else if (ret==-1) {
    898     owl_function_error("Could not read %s", foo);
    899   } else {
     896  } else if (ret == -1) {
     897    owl_function_error("Could not read %s", file ? file : "file");
     898  } else if (ret2 == -1) {
    900899    owl_function_error("Error subscribing to messages");
     900  } else {
     901    owl_function_error("Error subscribing to instanced personals");
    901902  }
    902903}
Note: See TracChangeset for help on using the changeset viewer.