Changeset 2558c00
- Timestamp:
- Apr 13, 2017, 6:43:21 PM (7 years ago)
- Parents:
- 678a7650 (diff), a2ae85a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Edward Z. Yang <ezyang@mit.edu> (04/13/17 18:43:21)
- git-committer:
- GitHub <noreply@github.com> (04/13/17 18:43:21)
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
README
r1c22155 ra2ae85a 55 55 The Twitter module requires: 56 56 57 HTML::Entities 57 HTML::Entities (or HTML::HTML5::Entities) 58 58 Net::Twitter::Lite 59 59 -
.travis.yml
r48c09d4 rbecd617 1 1 language: perl 2 sudo: false 2 3 compiler: 3 4 - clang … … 9 10 - "5.16" 10 11 - "5.18" 11 - "5.19" 12 install: 13 - sudo apt-get update -q 14 # we actually want debhelper >= 7, libperl-dev >= 5.10.1-8, libzephyr-dev >= 3.0~beta 15 - sudo apt-get install -q autoconf autotools-dev debhelper dh-autoreconf libglib2.0-dev libkrb5-dev libncurses5-dev libncursesw5-dev libssl-dev libzephyr-dev pkg-config zip 12 - "5.20" 13 addons: 14 apt: 15 # we actually want debhelper >= 7, libperl-dev >= 5.10.1-8, libzephyr-dev >= 3.0~beta 16 packages: 17 - autoconf 18 - autotools-dev 19 - debhelper 20 - dh-autoreconf 21 - libglib2.0-dev 22 - libkrb5-dev 23 - libncurses5-dev 24 - libncursesw5-dev 25 - libssl-dev 26 - libzephyr-dev 27 - pkg-config 28 - zip 16 29 # perl things 17 30 # In lp:~barnowl/barnowl/packaging, we use apt-get. Here, we use cpanm. 18 31 # - sudo apt-get install libanyevent-perl libclass-accessor-perl libextutils-depends-perl libglib-perl libmodule-install-perl libnet-twitter-lite-perl libpar-perl libperl-dev 19 - cpanm AnyEvent Class::Accessor ExtUtils::Depends Glib Module::Install Net::Twitter::Lite PAR 20 script: "./autogen.sh && ./configure && make distcheck"32 # It's taken care of by the default install script 33 script: ./autogen.sh && ./configure && make distcheck -
ChangeLog
r6f87658 r678a7650 1 1.10 2 * No changes above what's already in 1.10rc1 3 4 1.10rc1 5 * Numerous autotools/build machinery fixes -andersk@mit.edu 6 * Numerous code correctness and simplification/cleanup fixes -andersk@mit.edu 7 * Add and use a cpanfile documenting perl module dependencies -jgross@mit.edu 8 * Add Travis configuration -jgross@mit.edu 9 * Avoid strchrnul -andersk@mit.edu 10 * Numerous IRC fixes -jgross@mit.edu 11 * Improve smartnarrow and smartfilter documentation -jgross@mit.edu 12 * filterproc: Rewrite using GIOChannel -andersk@mit.edu 13 * Implement :twitter-favorite -nelhage@nelhage.com 14 * Kill the client-side tweet length check. -nelhage@nelhage.com 15 * squelch the Twitter legacy_list_api warnings -nelhage@nelhage.com 16 * Use SSL for Twitter by default -adehnert@mit.edu 17 * Humanize zsigs -andersk@mit.edu 18 * Show Zephyr charset in info popup -andersk@mit.edu 19 * Fix Jabber SRV record support (at one point fixed connecting via jabber to google talk or facebook) -james2vegas@aim.com 20 * fix cmd_join in BarnOwl/Module/IRC.pm -james2vegas@aim.com 21 * Add a ~/.owl/ircchannels file, persist channels -jgross@mit.edu 22 * Added hooks for user going idle or active. -jgross@mit.edu 23 * Support channel-or-user IRC commands, and setup irc-msg to use it. -ezyang@mit.edu 24 * Refactor perl calls through a single method -jgross@mit.edu 25 * Really support building Perl modules from a separate builddir -andersk@mit.edu 26 * Get rid of all our embedded copies of Module::Install -andersk@mit.edu 27 * Don't let new_variable_* overriding previously set values -rnjacobs@mit.edu 28 * Messages sent to 'class messages' are not personal -jgross@mit.edu 29 * Expose message_matches_filter to perl -jgross@mit.edu 30 * Fail fast on -c filsrv, which most people won't have permission to send to -rnjacobs@mit.edu 31 * zcrypt: Use getopt_long for argument parsing -andersk@mit.edu 32 * zcrypt: Accept -help and --version -andersk@mit.edu 33 * barnowl --help: Write to stdout and exit successfully -andersk@mit.edu 34 * Don't swallow errors in :unsuball -davidben@mit.edu 35 * Allow testing in a separate build directory -andersk@mit.edu 36 * Add support for arbitrary Perl subs for getters and setters for barnowl variables -glasgall@mit.edu 37 * owl_zephyr_loadsubs: Don’t leak memory on error opening ~/.zephyr.subs -andersk@mit.edu 38 * Make :loadsubs reload instanced personals too -davidben@mit.edu 39 * Fix some undefined behavior in filter.c, caught by clang scan-build -jgross@mit.edu 40 * Die on a failed zephyr_zwrite; don't silently ignore it -jgross@mit.edu 41 * Fix a memory leak in zcrypt.c, caught by clang scan-build -jgross@mit.edu 42 * zcrypt: Make gpg stop messing around in ~/.gnupg -andersk@mit.edu 43 * Fix display of pseudologins -davidben@mit.edu 44 * Unbundle random Facebook module libraries -davidben@mit.edu 45 * Replace deprecated GLib < 2.31.0 APIs -andersk@mit.edu 46 * Abstract g->interrupt_lock -andersk@mit.edu 47 * zephyr: Replace outgoing default format with a small URL -geofft@mit.edu 48 1 49 1.9 2 50 * Update Jabber module for Net::DNS changes -james2vegas@aim.com -
Makefile.am
rca1fb26a r392b5cf 2 2 3 3 GIT_DESCRIPTION := $(if $(wildcard $(srcdir)/.git),$(shell cd $(srcdir) && git describe --match='barnowl-*' HEAD 2>/dev/null)) 4 VERSION = $(if $(GIT_DESCRIPTION),$(GIT_DESCRIPTION:barnowl-%=%),@VERSION@) 5 -include BUILD_VERSION.mk 4 VERSION = $(if $(GIT_DESCRIPTION),$(GIT_DESCRIPTION:barnowl-%=%),$(DIST_VERSION)) 5 DIST_VERSION = @VERSION@ 6 -include $(srcdir)/DIST_VERSION.mk BUILD_VERSION.mk 6 7 7 8 FORCE: 8 9 BUILD_VERSION.mk: $(if $(filter-out $(BUILD_VERSION),$(VERSION)),FORCE) 9 10 echo 'BUILD_VERSION = $(VERSION)' > $@ 11 dist-hook:: $(if $(filter-out @VERSION@,$(VERSION)),dist-hook-version) 12 dist-hook-version: 13 echo 'DIST_VERSION = $(VERSION)' > $(distdir)/DIST_VERSION.mk 10 14 11 15 bin_PROGRAMS = bin/barnowl … … 14 18 endif 15 19 16 zcrypt_SOURCES = zcrypt.c filterproc.c version.c 20 zcrypt_SOURCES = zcrypt.c filterproc.c 21 nodist_zcrypt_SOURCES = version.c 17 22 18 23 check_PROGRAMS = bin/tester … … 104 109 105 110 CLEANFILES = $(BUILT_SOURCES) $(GEN_C) $(noinst_SCRIPTS) $(check_SCRIPTS) BUILD_VERSION.mk 111 MAINTAINERCLEANFILES = DIST_VERSION.mk 106 112 EXTRA_DIST = \ 107 113 autogen.sh \ … … 116 122 scripts \ 117 123 stubgen.pl \ 118 typemap 124 typemap \ 125 cpanfile 119 126 120 127 SUBDIRS = compat libfaim perl -
commands.c
rca1fb26a r8fcd3e7 548 548 "optional color arguments are used they specifies the colors that\n" 549 549 "messages matching this filter should be displayed in.\n\n" 550 "SEE ALSO: view, viewclass, viewuser\n"),550 "SEE ALSO: smartfilter, smartnarrow, view, viewclass, viewuser\n"), 551 551 552 552 OWLCMD_ARGS("colorview", owl_command_colorview, OWL_CTX_INTERACTIVE, … … 585 585 "filter expression that will be dynamically created by BarnOwl and then\n" 586 586 "applied as the view's filter\n" 587 "SEE ALSO: filter, viewclass, viewuser\n"),587 "SEE ALSO: filter, smartfilter, smartnarrow, viewclass, viewuser\n"), 588 588 589 589 OWLCMD_ARGS("smartnarrow", owl_command_smartnarrow, OWL_CTX_INTERACTIVE, … … 599 599 " then narrow to the class and instance.\n" 600 600 "If '-r' or '--related' is specified, behave as though the\n" 601 " 'narrow-related' variable was inverted."), 601 " 'narrow-related' variable was inverted.\n\n" 602 "SEE ALSO: filter, smartfilter, view, viewclass, viewuser\n"), 602 603 603 604 OWLCMD_ARGS("smartfilter", owl_command_smartfilter, OWL_CTX_INTERACTIVE, … … 610 611 "If the curmsg is a class message, the filter is that class.\n" 611 612 "If the curmsg is a class message and '-i' is specified\n" 612 " the filter is to that class and instance.\n"), 613 " the filter is to that class and instance.\n\n" 614 "SEE ALSO: filter, smartnarrow, view, viewclass, viewuser\n"), 613 615 614 616 OWLCMD_ARGS("viewclass", owl_command_viewclass, OWL_CTX_INTERACTIVE, … … 618 620 "matching the specified class and switch the current view\n" 619 621 "to it.\n\n" 620 "SEE ALSO: filter, view, viewuser\n"),622 "SEE ALSO: filter, smartfilter, smartnarrow, view, viewuser\n"), 621 623 OWLCMD_ALIAS("vc", "viewclass"), 622 624 … … 627 629 "matching the specified user and switch the current\n" 628 630 "view to it.\n\n" 629 "SEE ALSO: filter, view, viewclass\n"),631 "SEE ALSO: filter, smartfilter, smartnarrow, view, viewclass\n"), 630 632 OWLCMD_ALIAS("vu", "viewuser"), 631 633 OWLCMD_ALIAS("viewperson", "viewuser"), -
configure.ac
r77dfeb1 r370d94d 1 1 dnl Process this file with autoconf to produce a configure script. 2 AC_INIT([BarnOwl],[1.1 0dev],[bug-barnowl@mit.edu])2 AC_INIT([BarnOwl],[1.11dev],[bug-barnowl@mit.edu]) 3 3 AM_INIT_AUTOMAKE([1.7.0 foreign std-options -Wall -Wno-portability]) 4 4 AM_MAINTAINER_MODE([enable]) -
filterproc.c
r7155955 re8db357 1 1 #include "filterproc.h" 2 2 #include <sys/wait.h> 3 #include < fcntl.h>3 #include <string.h> 4 4 #include <glib.h> 5 #include <poll.h>6 #include <string.h>7 #include <unistd.h>8 5 9 /* Even in case of error, send_receive is responsible for closing wfd 10 * (to EOF the child) and rfd (for consistency). */ 11 static int send_receive(int rfd, int wfd, const char *out, char **in) 6 struct filter_data { 7 const char **in; 8 const char *in_end; 9 GString *out_str; 10 GMainLoop *loop; 11 int err; 12 }; 13 14 static gboolean filter_stdin(GIOChannel *channel, GIOCondition condition, gpointer data_) 12 15 { 13 GString *str = g_string_new(""); 14 char buf[1024]; 15 nfds_t nfds; 16 int err = 0; 17 struct pollfd fds[2]; 16 struct filter_data *data = data_; 17 gboolean done = condition & (G_IO_ERR | G_IO_HUP); 18 18 19 fcntl(rfd, F_SETFL, O_NONBLOCK | fcntl(rfd, F_GETFL)); 20 fcntl(wfd, F_SETFL, O_NONBLOCK | fcntl(wfd, F_GETFL)); 21 22 fds[0].fd = rfd; 23 fds[0].events = POLLIN; 24 fds[1].fd = wfd; 25 fds[1].events = POLLOUT; 26 27 if(!out || !*out) { 28 /* Nothing to write. Close our end so the child doesn't hang waiting. */ 29 close(wfd); wfd = -1; 30 out = NULL; 19 if (condition & G_IO_OUT) { 20 gsize n; 21 GIOStatus ret = g_io_channel_write_chars(channel, *data->in, data->in_end - *data->in, &n, NULL); 22 *data->in += n; 23 if (ret == G_IO_STATUS_ERROR) 24 data->err = 1; 25 if (ret == G_IO_STATUS_ERROR || *data->in == data->in_end) 26 done = TRUE; 31 27 } 32 28 33 while(1) { 34 if(out && *out) { 35 nfds = 2; 36 } else { 37 nfds = 1; 38 } 39 err = poll(fds, nfds, -1); 40 if(err < 0) { 41 break; 42 } 43 if(out && *out) { 44 if(fds[1].revents & POLLOUT) { 45 err = write(wfd, out, strlen(out)); 46 if(err > 0) { 47 out += err; 48 } 49 if(err < 0) { 50 out = NULL; 51 } 52 } 53 if(!out || !*out || fds[1].revents & (POLLERR | POLLHUP)) { 54 close(wfd); wfd = -1; 55 out = NULL; 56 } 57 } 58 if(fds[0].revents & POLLIN) { 59 err = read(rfd, buf, sizeof(buf)); 60 if(err <= 0) { 61 break; 62 } 63 g_string_append_len(str, buf, err); 64 } else if(fds[0].revents & (POLLHUP | POLLERR)) { 65 err = 0; 66 break; 29 if (condition & G_IO_ERR) 30 data->err = 1; 31 32 if (done) 33 g_io_channel_shutdown(channel, TRUE, NULL); 34 return !done; 35 } 36 37 static gboolean filter_stdout(GIOChannel *channel, GIOCondition condition, gpointer data_) 38 { 39 struct filter_data *data = data_; 40 gboolean done = condition & (G_IO_ERR | G_IO_HUP); 41 42 if (condition & (G_IO_IN | G_IO_HUP)) { 43 gchar *buf; 44 gsize n; 45 GIOStatus ret = g_io_channel_read_to_end(channel, &buf, &n, NULL); 46 g_string_append_len(data->out_str, buf, n); 47 g_free(buf); 48 if (ret == G_IO_STATUS_ERROR) { 49 data->err = 1; 50 done = TRUE; 67 51 } 68 52 } 69 53 70 if (wfd >= 0) close(wfd); 71 close(rfd); 72 *in = g_string_free(str, err < 0); 73 return err; 54 if (condition & G_IO_ERR) 55 data->err = 1; 56 57 if (done) { 58 g_io_channel_shutdown(channel, TRUE, NULL); 59 g_main_loop_quit(data->loop); 60 } 61 return !done; 74 62 } 75 63 76 64 int call_filter(const char *const *argv, const char *in, char **out, int *status) 77 65 { 78 int err;79 66 GPid child_pid; 80 67 int child_stdin, child_stdout; … … 89 76 } 90 77 91 err = send_receive(child_stdout, child_stdin, in, out); 92 if (err == 0) { 93 waitpid(child_pid, status, 0); 94 } 95 return err; 78 if (in == NULL) in = ""; 79 GMainContext *context = g_main_context_new(); 80 struct filter_data data = {&in, in + strlen(in), g_string_new(""), g_main_loop_new(context, FALSE), 0}; 81 82 GIOChannel *channel = g_io_channel_unix_new(child_stdin); 83 g_io_channel_set_encoding(channel, NULL, NULL); 84 g_io_channel_set_flags(channel, g_io_channel_get_flags(channel) | G_IO_FLAG_NONBLOCK, NULL); 85 GSource *source = g_io_create_watch(channel, G_IO_OUT | G_IO_ERR | G_IO_HUP); 86 g_io_channel_unref(channel); 87 g_source_set_callback(source, (GSourceFunc)filter_stdin, &data, NULL); 88 g_source_attach(source, context); 89 g_source_unref(source); 90 91 channel = g_io_channel_unix_new(child_stdout); 92 g_io_channel_set_encoding(channel, NULL, NULL); 93 g_io_channel_set_flags(channel, g_io_channel_get_flags(channel) | G_IO_FLAG_NONBLOCK, NULL); 94 source = g_io_create_watch(channel, G_IO_IN | G_IO_ERR | G_IO_HUP); 95 g_io_channel_unref(channel); 96 g_source_set_callback(source, (GSourceFunc)filter_stdout, &data, NULL); 97 g_source_attach(source, context); 98 g_source_unref(source); 99 100 g_main_loop_run(data.loop); 101 102 g_main_loop_unref(data.loop); 103 g_main_context_unref(context); 104 105 waitpid(child_pid, status, 0); 106 g_spawn_close_pid(child_pid); 107 *out = g_string_free(data.out_str, data.err); 108 return data.err; 96 109 } -
functions.c
r7dcef03 rb61ad80 1227 1227 time_t now; 1228 1228 va_list ap; 1229 va_start(ap, fmt);1230 1229 1231 1230 if (!owl_global_is_debug_fast(&g)) … … 1242 1241 (int) getpid(), tmpbuff, now - owl_global_get_starttime(&g)); 1243 1242 g_free(tmpbuff); 1243 1244 va_start(ap, fmt); 1244 1245 vfprintf(file, fmt, ap); 1246 va_end(ap); 1247 1245 1248 putc('\n', file); 1246 1249 fflush(file); 1247 1248 va_end(ap);1249 1250 } 1250 1251 -
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
r926c721 rd4f33f1 562 562 "[" . $conn->alias . "] Reconnect cancelled"); 563 563 $conn->cancel_reconnect; 564 delete $ircnets{$conn->alias}; 565 } elsif (exists $ircnets{$conn->alias}) { # inconsistent state; no socket, but not yet deleted 566 BarnOwl::admin_message('IRC', 567 "[" . $conn->alias . "] Attempt to disconnect from a socketless connection; deleting it"); 564 568 delete $ircnets{$conn->alias}; 565 569 } -
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
rbe43554 r4379288 437 437 } 438 438 439 sub rejoin_channels { 440 my $self = shift; 441 my @channels = @_; 442 # As reported in https://barnowl.mit.edu/ticket/274, if we reconnect to 443 # too many at once, the server rejects us. Empirically, this is about 444 # 20-26, so we set the cap at 15, then delay further joins for 5 seconds. 445 my $MAX_RECONNECT_CHANNELS = 15; 446 my $DELAY = 5; 447 foreach my $c (@channels[ 0 .. $MAX_RECONNECT_CHANNELS ]) { 448 $self->conn->send_msg(join => $c); 449 } 450 if ($MAX_RECONNECT_CHANNELS < $#channels) { 451 my $remaining = $#channels - $MAX_RECONNECT_CHANNELS; 452 my $cur_alias = $self->alias; 453 BarnOwl::admin_message('IRC', "[$cur_alias] Delaying $remaining autorejoins for $DELAY seconds"); 454 # if we don't assign the timer to anything, then it gets garbage 455 # collected, and never runs 456 $self->{autoconnect_channels_delay_timer} = BarnOwl::Timer->new({ 457 name => "IRC rejoin overflow timer ($remaining remaining)", 458 after => $DELAY, 459 cb => sub { 460 rejoin_channels($self, @channels[ $MAX_RECONNECT_CHANNELS .. $#channels ]); 461 } 462 }); 463 } 464 } 465 466 439 467 sub connected { 440 468 my $self = shift; … … 443 471 $self->cancel_reconnect; 444 472 if ($self->autoconnect_channels) { 445 for my $c (@{$self->autoconnect_channels}) { 446 $self->conn->send_msg(join => $c); 447 } 473 rejoin_channels($self, @{$self->autoconnect_channels}); 448 474 } 449 475 $self->conn->enable_ping(60, sub { -
scripts/do-release
rb8a3e00 rbc308eb 1 #!/bin/sh -e 1 #!/bin/bash 2 set -eu 2 3 3 4 die() { … … 55 56 fi 56 57 58 [ -e Makefile.in ] || autoreconf -fvi 59 [ -e config.status ] || ./configure 60 make -j4 distcheck VERSION="$VERS" 61 62 echo 'Checking distributed files against Git:' 63 if comm -3 <(tar -tzf "$TAG.tar.gz" | grep -v '/$' | sed "s%^$TAG/%%" | sort) \ 64 <(git ls-files | sort) | grep -vxf scripts/dist-ignore; then 65 echo 66 echo 'Error: Please fix Makefile.am and/or scripts/dist-ignore.' 67 exit 1 68 fi 69 echo 'ok' 70 71 mv "$TAG.tar.gz" "$TGZ.tgz" 72 57 73 if ! [ "$no_tag" ]; then 58 74 if git cat-file -t "$TAG" > /dev/null 2>&1; then … … 65 81 fi 66 82 67 exittrap() { :; } 68 for sig in 1 2 13 15; do trap "exit $(($sig + 128))" $sig; done 69 trap 'exittrap' EXIT 70 71 TMPDIR=$(mktemp -d /tmp/barnowl.XXXXXX) 72 73 exittrap() { rm -rf "$TMPDIR"; } 74 75 git archive --format=tar --prefix="$TGZ/" "$TAG" | tar -x -C "$TMPDIR" 76 77 CODIR=$(pwd) 78 cd "$TMPDIR/$TGZ" 79 [ "$git" ] && perl -i -pe 's{^(AC_INIT\(\[[^\]]+\],\s*)\[([^\]]+)\]}{${1}['$VERS']}' configure.ac 80 autoreconf -fvi 81 rm -r autom4te.cache/ 82 cd "$TMPDIR" 83 tar czvf "$TGZ.tgz" "$TGZ" 84 cd "$CODIR" 85 86 mv "$TMPDIR/$TGZ.tgz" . 87 rm -rf "$TMPDIR" 88 89 exittrap() { :; } 90 91 echo "Created release tarball for BarnOwl $VERS in $(pwd)" 83 echo "Created release tarball for BarnOwl $VERS at $(pwd)/$TGZ.tgz" 92 84 echo "Remember to bump OWL_VERSION_STRING for future development." 93 85 -
util.c
r7b89e8c rcba6b9c 468 468 if (fstat(fileno(old), &st) != 0) { 469 469 owl_function_error("Cannot stat %s: %s", filename, strerror(errno)); 470 fclose(old); 470 471 return -1; 471 472 } … … 473 474 /* resolve symlinks, because link() fails on symlinks, at least on AFS */ 474 475 actual_filename = owl_util_recursive_resolve_link(filename); 475 if (actual_filename == NULL) 476 if (actual_filename == NULL) { 477 fclose(old); 476 478 return -1; /* resolving the symlink failed, but we already logged this error */ 479 } 477 480 478 481 newfile = g_strdup_printf("%s.new", actual_filename); -
variable.c
r7dcef03 r94b9ee0 1038 1038 CALLER_OWN char *owl_variable_bool_get_tostring_default(const owl_variable *v, void *dummy) 1039 1039 { 1040 bool val = owl_variable_get_bool(v); 1041 if (val == 0) { 1042 return g_strdup("off"); 1043 } else if (val == 1) { 1044 return g_strdup("on"); 1045 } else { 1046 return g_strdup("<invalid>"); 1047 } 1040 return g_strdup(owl_variable_get_bool(v) ? "on" : "off"); 1048 1041 } 1049 1042 -
zephyr.c
r7dcef03 rff58239 283 283 #ifdef HAVE_LIBZEPHYR 284 284 FILE *file; 285 int fopen_errno; 285 286 char *tmp, *start; 286 287 char *buffer = NULL; … … 289 290 int subSize = 1024; 290 291 int count; 291 struct stat statbuff;292 292 293 293 subsfile = owl_zephyr_dotfile(".zephyr.subs", filename); 294 294 295 if (stat(subsfile, &statbuff) != 0) { 296 g_free(subsfile); 297 if (error_on_nofile == 1) 295 count = 0; 296 file = fopen(subsfile, "r"); 297 fopen_errno = errno; 298 g_free(subsfile); 299 if (!file) { 300 if (error_on_nofile == 1 || fopen_errno != ENOENT) 298 301 return -1; 299 302 return 0; 300 303 } 301 302 ZResetAuthentication();303 count = 0;304 file = fopen(subsfile, "r");305 g_free(subsfile);306 if (!file)307 return -1;308 304 309 305 subs = g_new(ZSubscription_t, subSize); … … 348 344 g_free(buffer); 349 345 346 ZResetAuthentication(); 350 347 return owl_zephyr_loadsubs_helper(subs, count); 351 348 #else … … 412 409 char *buffer = NULL; 413 410 int count; 414 struct stat statbuff;415 411 416 412 subs = g_new(ZSubscription_t, numSubs); 417 413 subsfile = owl_zephyr_dotfile(".anyone", filename); 418 414 419 if (stat(subsfile, &statbuff) == -1) {420 g_free(subs);421 g_free(subsfile);422 return 0;423 }424 425 ZResetAuthentication();426 415 count = 0; 427 416 file = fopen(subsfile, "r"); … … 445 434 fclose(file); 446 435 } else { 436 g_free(subs); 447 437 return 0; 448 438 } 449 439 g_free(buffer); 450 440 441 ZResetAuthentication(); 451 442 return owl_zephyr_loadsubs_helper(subs, count); 452 443 #else … … 1320 1311 { 1321 1312 int n = strcspn(in, "./"); 1322 char *realm = strchrnul(in, '@'); 1313 const char *realm = strchr(in, '@'); 1314 if (realm == NULL) 1315 realm = in + strlen(in); 1323 1316 1324 1317 if (in + n >= realm ||
Note: See TracChangeset
for help on using the changeset viewer.