Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/tmux/dist Import tmux 1.5:



details:   https://anonhg.NetBSD.org/src/rev/bc80bb7b8766
branches:  trunk
changeset: 768501:bc80bb7b8766
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Wed Aug 17 18:40:03 2011 +0000

description:
Import tmux 1.5:

CHANGES FROM 1.4 TO 1.5, 09 July 2011

* Support xterm mouse modes 1002 and 1003.
* Change from a per-session stack of buffers to one global stack. This renders
  copy-buffer useless and makes buffer-limit now a server option.
* Fix most-recently-used choice by avoiding reset the activity timer for
  unattached sessions every second.
* Add a -P option to new-window and split-window to print the new window or
  pane index in target form (useful to pass it into other commands).
* Handle a # at the end of a replacement string (such as status-left)
  correctly.
* Support for UTF-8 mouse input (\033[1005h) which was added in xterm 262.
  If the new mouse-utf8 option is on, UTF-8 mouse input is enabled for all
  UTF-8 terminals. The option defaults to on if LANG etc are set in the same
  manner as the utf8 option.
* Support for HP-UX.
* Accept colours of the hex form #ffffff and translate to the nearest from the
  xterm(1) 256-colour set.
* Clear the non-blocking IO flag (O_NONBLOCK) on the stdio file descriptors
  before closing them (fixes things like "tmux ls && cat").
* Use TMPDIR if set.
* Fix next and previous session functions to actually work.
* Support -x and -y for new-session to specify the initial size of the window
  if created detached with -d.
* Make bind-key accept characters with the top-bit-set and print them as octal.
* Set $TMUX without the session when background jobs are run.
* Simplify the way jobs work and drop the persist type, so all jobs are
  fire-and-forget.
* Accept tcgetattr/tcsetattr(3) failure, fixes problems with fatal() if the
  terminal disappears while locked.
* Add a -P option to detach to HUP the client's parent process (usually causing
  it to exit as well).
* Support passing through escape sequences to the underlying terminal by using
  DCS with a "tmux;" prefix.
* Prevent tiled producing a corrupt layout when only one column is needed.
* Give each pane created in a tmux server a unique id (starting from 0), put it
  in the TMUX_PANE environment variable and accept it as a target.
* Allow a start and end line to be specified for capture-pane which may be
  negative to capture part of the history.
* Add -a and -s options to lsp to list all panes in the server or session
  respectively. Likewise add -s to lsw.
* Change -t on display-message to be target-pane for the #[A-Z] replacements
  and add -c as target-client.
* The attach-session command now prefers the most recently used unattached
  session.
* Add -s option to detach-client to detach all clients attached to a session.
* Add -t to list-clients.
* Change window with mouse wheel over status line if mouse-select-window is on.
* When mode-mouse is on, automatically enter copy mode when the mouse is
  dragged or the mouse wheel is used. Also exit copy mode when the mouse wheel
  is scrolled off the bottom.
* Provide #h character pair for short hostname (no domain).
* Don't use strnvis(3) for the title as it breaks UTF-8.
* Use the tsl and fsl terminfo(5) capabilities to update terminal title and
  automatically fill them in on terminals with the XT capability (which means
  their title setting is xterm-compatible).
* Add a new option, mouse-resize-pane. When on, panes may be resized by
  dragging their borders.
* Fix crash by resetting last pane on {break,swap}-pane across windows.
* Add three new copy-mode commands - select-line, copy-line, copy-end-of-line.
* Support setting the xterm clipboard when copying from copy mode using the
  xterm escape sequence for the purpose (if xterm is configured to allow it).
* Support xterm(1) cursor colour change sequences through terminfo(5) Cc
  (set) and Cr (reset) extensions.
* Support DECSCUSR sequence to set the cursor style with two new terminfo(5)
  extensions, Cs and Csr.
* Make the command-prompt custom prompts recognize the status-left option
  character pairs.
* Add a respawn-pane command.
* Add a couple of extra xterm-style keys that gnome terminal provides.
* Allow the initial context on prompts to be set with the new -I option to
  command-prompt. Include the current window and session name in the prompt
  when renaming and add a new key binding ($) for rename session.
* Option bell-on-alert added to trigger the terminal bell when there is an
  alert.
* Change the list-keys format so that it shows the keys using actual tmux
  commands which should be able to be directly copied into the config file.
* Show full targets for lsp/lsw -a.
* Make confirm-before prompt customizable with -p option like command-prompt
  and add the character pairs #W and #P to the default kill-{pane,window}
  prompts.
* Avoid sending data to suspended/locked clients.
* Small memory leaks in error paths plugged.
* Vi mode improvements.

diffstat:

 external/bsd/tmux/dist/arguments.c               |  222 +++++++
 external/bsd/tmux/dist/array.h                   |    2 +-
 external/bsd/tmux/dist/attributes.c              |    2 +-
 external/bsd/tmux/dist/cfg.c                     |   12 +-
 external/bsd/tmux/dist/client.c                  |   28 +-
 external/bsd/tmux/dist/clock.c                   |    2 +-
 external/bsd/tmux/dist/cmd-attach-session.c      |   36 +-
 external/bsd/tmux/dist/cmd-bind-key.c            |  199 +-----
 external/bsd/tmux/dist/cmd-break-pane.c          |   39 +-
 external/bsd/tmux/dist/cmd-capture-pane.c        |   80 ++-
 external/bsd/tmux/dist/cmd-choose-buffer.c       |   31 +-
 external/bsd/tmux/dist/cmd-choose-client.c       |   21 +-
 external/bsd/tmux/dist/cmd-choose-session.c      |   21 +-
 external/bsd/tmux/dist/cmd-choose-window.c       |   44 +-
 external/bsd/tmux/dist/cmd-clear-history.c       |   17 +-
 external/bsd/tmux/dist/cmd-clock-mode.c          |   17 +-
 external/bsd/tmux/dist/cmd-command-prompt.c      |  195 ++----
 external/bsd/tmux/dist/cmd-confirm-before.c      |   59 +-
 external/bsd/tmux/dist/cmd-copy-mode.c           |   36 +-
 external/bsd/tmux/dist/cmd-delete-buffer.c       |   37 +-
 external/bsd/tmux/dist/cmd-detach-client.c       |   46 +-
 external/bsd/tmux/dist/cmd-display-message.c     |   40 +-
 external/bsd/tmux/dist/cmd-display-panes.c       |   19 +-
 external/bsd/tmux/dist/cmd-find-window.c         |   27 +-
 external/bsd/tmux/dist/cmd-has-session.c         |   17 +-
 external/bsd/tmux/dist/cmd-if-shell.c            |   29 +-
 external/bsd/tmux/dist/cmd-join-pane.c           |  198 +-----
 external/bsd/tmux/dist/cmd-kill-pane.c           |   19 +-
 external/bsd/tmux/dist/cmd-kill-server.c         |    9 +-
 external/bsd/tmux/dist/cmd-kill-session.c        |   19 +-
 external/bsd/tmux/dist/cmd-kill-window.c         |   19 +-
 external/bsd/tmux/dist/cmd-link-window.c         |   31 +-
 external/bsd/tmux/dist/cmd-list-buffers.c        |   25 +-
 external/bsd/tmux/dist/cmd-list-clients.c        |   25 +-
 external/bsd/tmux/dist/cmd-list-commands.c       |    9 +-
 external/bsd/tmux/dist/cmd-list-keys.c           |   81 +-
 external/bsd/tmux/dist/cmd-list-panes.c          |   99 ++-
 external/bsd/tmux/dist/cmd-list-sessions.c       |   12 +-
 external/bsd/tmux/dist/cmd-list-windows.c        |   72 +-
 external/bsd/tmux/dist/cmd-list.c                |    2 +-
 external/bsd/tmux/dist/cmd-load-buffer.c         |  125 +--
 external/bsd/tmux/dist/cmd-lock-server.c         |   45 +-
 external/bsd/tmux/dist/cmd-move-window.c         |   31 +-
 external/bsd/tmux/dist/cmd-new-session.c         |  207 ++----
 external/bsd/tmux/dist/cmd-new-window.c          |  160 +----
 external/bsd/tmux/dist/cmd-pipe-pane.c           |   31 +-
 external/bsd/tmux/dist/cmd-refresh-client.c      |   19 +-
 external/bsd/tmux/dist/cmd-rename-session.c      |   31 +-
 external/bsd/tmux/dist/cmd-rename-window.c       |   23 +-
 external/bsd/tmux/dist/cmd-resize-pane.c         |  100 +-
 external/bsd/tmux/dist/cmd-respawn-pane.c        |   88 +++
 external/bsd/tmux/dist/cmd-respawn-window.c      |   29 +-
 external/bsd/tmux/dist/cmd-rotate-window.c       |   31 +-
 external/bsd/tmux/dist/cmd-run-shell.c           |   23 +-
 external/bsd/tmux/dist/cmd-save-buffer.c         |   61 +-
 external/bsd/tmux/dist/cmd-select-layout.c       |  113 ++-
 external/bsd/tmux/dist/cmd-select-pane.c         |   76 +-
 external/bsd/tmux/dist/cmd-select-window.c       |  112 +++-
 external/bsd/tmux/dist/cmd-send-keys.c           |  128 +---
 external/bsd/tmux/dist/cmd-send-prefix.c         |   17 +-
 external/bsd/tmux/dist/cmd-set-buffer.c          |   49 +-
 external/bsd/tmux/dist/cmd-set-environment.c     |   48 +-
 external/bsd/tmux/dist/cmd-set-option.c          |  662 ++++++++--------------
 external/bsd/tmux/dist/cmd-show-buffer.c         |   44 +-
 external/bsd/tmux/dist/cmd-show-environment.c    |   25 +-
 external/bsd/tmux/dist/cmd-show-messages.c       |   25 +-
 external/bsd/tmux/dist/cmd-show-options.c        |   65 +-
 external/bsd/tmux/dist/cmd-source-file.c         |  115 +--
 external/bsd/tmux/dist/cmd-split-window.c        |  216 +-----
 external/bsd/tmux/dist/cmd-start-server.c        |    9 +-
 external/bsd/tmux/dist/cmd-suspend-client.c      |   26 +-
 external/bsd/tmux/dist/cmd-swap-pane.c           |   52 +-
 external/bsd/tmux/dist/cmd-swap-window.c         |   24 +-
 external/bsd/tmux/dist/cmd-switch-client.c       |  155 +----
 external/bsd/tmux/dist/cmd-unbind-key.c          |  132 +---
 external/bsd/tmux/dist/cmd-unlink-window.c       |   19 +-
 external/bsd/tmux/dist/cmd.c                     |  223 +++++--
 external/bsd/tmux/dist/colour.c                  |  121 ++++-
 external/bsd/tmux/dist/compat.h                  |   13 +-
 external/bsd/tmux/dist/compat/asprintf.c         |   49 +-
 external/bsd/tmux/dist/compat/bitstring.h        |    4 +-
 external/bsd/tmux/dist/compat/closefrom.c        |    2 +-
 external/bsd/tmux/dist/compat/daemon.c           |    1 +
 external/bsd/tmux/dist/compat/fgetln.c           |    4 +-
 external/bsd/tmux/dist/compat/forkpty-aix.c      |    6 +-
 external/bsd/tmux/dist/compat/forkpty-hpux.c     |   89 +++
 external/bsd/tmux/dist/compat/forkpty-sunos.c    |    4 +-
 external/bsd/tmux/dist/compat/getopt.c           |    2 +-
 external/bsd/tmux/dist/compat/imsg.h             |    2 +-
 external/bsd/tmux/dist/compat/queue.h            |    4 +-
 external/bsd/tmux/dist/compat/setenv.c           |    2 +-
 external/bsd/tmux/dist/compat/strcasestr.c       |    4 +-
 external/bsd/tmux/dist/compat/strlcat.c          |    2 +-
 external/bsd/tmux/dist/compat/strlcpy.c          |    2 +-
 external/bsd/tmux/dist/compat/strsep.c           |    4 +-
 external/bsd/tmux/dist/compat/strtonum.c         |    2 +-
 external/bsd/tmux/dist/compat/tree.h             |    2 +-
 external/bsd/tmux/dist/compat/unvis.c            |   33 +-
 external/bsd/tmux/dist/compat/vis.c              |    5 +-
 external/bsd/tmux/dist/compat/vis.h              |    4 +-
 external/bsd/tmux/dist/examples/h-boetes.conf    |    2 +-
 external/bsd/tmux/dist/examples/n-marriott.conf  |    2 +-
 external/bsd/tmux/dist/examples/screen-keys.conf |    2 +-
 external/bsd/tmux/dist/examples/t-williams.conf  |    2 +-
 external/bsd/tmux/dist/examples/tmux.vim         |    2 +-
 external/bsd/tmux/dist/examples/tmux_backup.sh   |   81 ++
 external/bsd/tmux/dist/examples/vim-keys.conf    |    2 +-
 external/bsd/tmux/dist/grid-utf8.c               |    2 +-
 external/bsd/tmux/dist/grid-view.c               |   26 +-
 external/bsd/tmux/dist/grid.c                    |    2 +-
 external/bsd/tmux/dist/input-keys.c              |   43 +-
 external/bsd/tmux/dist/key-bindings.c            |   10 +-
 external/bsd/tmux/dist/key-string.c              |   12 +-
 external/bsd/tmux/dist/layout-custom.c           |   13 +-
 external/bsd/tmux/dist/layout-set.c              |    4 +-
 external/bsd/tmux/dist/layout.c                  |   49 +-
 external/bsd/tmux/dist/log.c                     |    2 +-
 external/bsd/tmux/dist/mode-key.c                |   18 +-
 external/bsd/tmux/dist/names.c                   |    2 +-
 external/bsd/tmux/dist/options-table.c           |  666 +++++++++++++++++++++++
 external/bsd/tmux/dist/osdep-aix.c               |   35 +
 external/bsd/tmux/dist/osdep-darwin.c            |   20 +-
 external/bsd/tmux/dist/osdep-freebsd.c           |   15 +-
 external/bsd/tmux/dist/osdep-hpux.c              |   35 +
 external/bsd/tmux/dist/osdep-linux.c             |   19 +-
 external/bsd/tmux/dist/osdep-netbsd.c            |   10 +-
 external/bsd/tmux/dist/osdep-openbsd.c           |   28 +-
 external/bsd/tmux/dist/osdep-sunos.c             |    9 +-
 external/bsd/tmux/dist/osdep-unknown.c           |   10 +-
 external/bsd/tmux/dist/paste.c                   |   17 +-
 external/bsd/tmux/dist/resize.c                  |    2 +-
 external/bsd/tmux/dist/screen-redraw.c           |    6 +-
 external/bsd/tmux/dist/server-client.c           |  134 +++-
 external/bsd/tmux/dist/server-window.c           |   25 +-
 external/bsd/tmux/dist/server.c                  |   28 +-
 external/bsd/tmux/dist/signal.c                  |    2 +-
 external/bsd/tmux/dist/status.c                  |  274 ++++++---
 external/bsd/tmux/dist/tmux.1                    |  355 ++++++++++--
 external/bsd/tmux/dist/tmux.c                    |  224 +-----
 external/bsd/tmux/dist/tmux.h                    |  357 ++++++-----
 external/bsd/tmux/dist/tty.c                     |  164 ++++-
 external/bsd/tmux/dist/utf8.c                    |   15 +-
 external/bsd/tmux/dist/window-choose.c           |    4 +-
 external/bsd/tmux/dist/window-clock.c            |    2 +-
 external/bsd/tmux/dist/window-copy.c             |  110 ++-
 external/bsd/tmux/dist/xmalloc.c                 |    2 +-
 external/bsd/tmux/dist/xterm-keys.c              |   26 +-
 147 files changed, 4918 insertions(+), 3550 deletions(-)

diffs (truncated from 14204 to 300 lines):

diff -r c22ea56507fc -r bc80bb7b8766 external/bsd/tmux/dist/arguments.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/tmux/dist/arguments.c        Wed Aug 17 18:40:03 2011 +0000
@@ -0,0 +1,222 @@
+/* $Id: arguments.c,v 1.1.1.1 2011/08/17 18:40:04 jmmv Exp $ */
+
+/*
+ * Copyright (c) 2010 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "tmux.h"
+
+/* Create an arguments set with no flags. */
+struct args *
+args_create(int argc, ...)
+{
+       struct args     *args;
+       va_list          ap;
+       int              i;
+
+       args = xcalloc(1, sizeof *args);
+       if ((args->flags = bit_alloc(SCHAR_MAX)) == NULL)
+               fatal("bit_alloc failed");
+
+       args->argc = argc;
+       if (argc == 0)
+               args->argv = NULL;
+       else
+               args->argv = xcalloc(argc, sizeof *args->argv);
+
+       va_start(ap, argc);
+       for (i = 0; i < argc; i++)
+               args->argv[i] = xstrdup(va_arg(ap, char *));
+       va_end(ap);
+
+       return (args);
+}
+
+/* Parse an argv and argc into a new argument set. */
+struct args *
+args_parse(const char *template, int argc, char **argv)
+{
+       struct args     *args;
+       char            *ptr;
+       int              opt;
+
+       args = xcalloc(1, sizeof *args);
+       if ((args->flags = bit_alloc(SCHAR_MAX)) == NULL)
+               fatal("bit_alloc failed");
+
+       optreset = 1;
+       optind = 1;
+
+       while ((opt = getopt(argc, argv, template)) != -1) {
+               if (opt < 0 || opt >= SCHAR_MAX)
+                       continue;
+               if (opt == '?' || (ptr = strchr(template, opt)) == NULL) {
+                       xfree(args->flags);
+                       xfree(args);
+                       return (NULL);
+               }
+
+               bit_set(args->flags, opt);
+               if (ptr[1] == ':') {
+                       if (args->values[opt] != NULL)
+                               xfree(args->values[opt]);
+                       args->values[opt] = xstrdup(optarg);
+               }
+       }
+       argc -= optind;
+       argv += optind;
+
+       args->argc = argc;
+       args->argv = cmd_copy_argv(argc, argv);
+
+       return (args);
+}
+
+/* Free an arguments set. */
+void
+args_free(struct args *args)
+{
+       u_int   i;
+
+       cmd_free_argv(args->argc, args->argv);
+
+       for (i = 0; i < SCHAR_MAX; i++) {
+               if (args->values[i] != NULL)
+                       xfree(args->values[i]);
+       }
+
+       xfree(args->flags);
+       xfree(args);
+}
+
+/* Print a set of arguments. */
+size_t
+args_print(struct args *args, char *buf, size_t len)
+{
+       size_t           off;
+       int              i;
+       const char      *quotes;
+
+       /* There must be at least one byte at the start. */
+       if (len == 0)
+               return (0);
+       off = 0;
+
+       /* Process the flags first. */
+       buf[off++] = '-';
+       for (i = 0; i < SCHAR_MAX; i++) {
+               if (!bit_test(args->flags, i) || args->values[i] != NULL)
+                       continue;
+
+               if (off == len - 1) {
+                       buf[off] = '\0';
+                       return (len);
+               }
+               buf[off++] = i;
+               buf[off] = '\0';
+       }
+       if (off == 1)
+               buf[--off] = '\0';
+
+       /* Then the flags with arguments. */
+       for (i = 0; i < SCHAR_MAX; i++) {
+               if (!bit_test(args->flags, i) || args->values[i] == NULL)
+                       continue;
+
+               if (off >= len) {
+                       /* snprintf will have zero terminated. */
+                       return (len);
+               }
+
+               if (strchr(args->values[i], ' ') != NULL)
+                       quotes = "\"";
+               else
+                       quotes = "";
+               off += xsnprintf(buf + off, len - off, "%s-%c %s%s%s",
+                   off != 0 ? " " : "", i, quotes, args->values[i], quotes);
+       }
+
+       /* And finally the argument vector. */
+       for (i = 0; i < args->argc; i++) {
+               if (off >= len) {
+                       /* snprintf will have zero terminated. */
+                       return (len);
+               }
+
+               if (strchr(args->argv[i], ' ') != NULL)
+                       quotes = "\"";
+               else
+                       quotes = "";
+               off += xsnprintf(buf + off, len - off, "%s%s%s%s",
+                   off != 0 ? " " : "", quotes, args->argv[i], quotes);
+       }
+
+       return (off);
+}
+
+/* Return if an argument is present. */
+int
+args_has(struct args *args, u_char ch)
+{
+       return (bit_test(args->flags, ch));
+}
+
+/* Set argument value. */
+void
+args_set(struct args *args, u_char ch, const char *value)
+{
+       if (args->values[ch] != NULL)
+               xfree(args->values[ch]);
+       if (value != NULL)
+               args->values[ch] = xstrdup(value);
+       else
+               args->values[ch] = NULL;
+       bit_set(args->flags, ch);
+}
+
+/* Get argument value. Will be NULL if it isn't present. */
+const char *
+args_get(struct args *args, u_char ch)
+{
+       return (args->values[ch]);
+}
+
+/* Convert an argument value to a number. */
+long long
+args_strtonum(struct args *args,
+    u_char ch, long long minval, long long maxval, char **cause)
+{
+       const char      *errstr;
+       long long        ll;
+
+       if (!args_has(args, ch)) {
+               *cause = xstrdup("missing");
+               return (0);
+       }
+
+       ll = strtonum(args->values[ch], minval, maxval, &errstr);
+       if (errstr != NULL) {
+               *cause = xstrdup(errstr);
+               return (0);
+       }
+
+       *cause = NULL;
+       return (ll);
+}
diff -r c22ea56507fc -r bc80bb7b8766 external/bsd/tmux/dist/array.h
--- a/external/bsd/tmux/dist/array.h    Wed Aug 17 18:37:59 2011 +0000
+++ b/external/bsd/tmux/dist/array.h    Wed Aug 17 18:40:03 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: array.h,v 1.1.1.1 2011/03/10 09:15:36 jmmv Exp $ */
+/* $Id: array.h,v 1.1.1.2 2011/08/17 18:40:05 jmmv Exp $ */
 
 /*
  * Copyright (c) 2006 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
diff -r c22ea56507fc -r bc80bb7b8766 external/bsd/tmux/dist/attributes.c
--- a/external/bsd/tmux/dist/attributes.c       Wed Aug 17 18:37:59 2011 +0000
+++ b/external/bsd/tmux/dist/attributes.c       Wed Aug 17 18:40:03 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: attributes.c,v 1.1.1.1 2011/03/10 09:15:36 jmmv Exp $ */
+/* $Id: attributes.c,v 1.1.1.2 2011/08/17 18:40:04 jmmv Exp $ */
 
 /*
  * Copyright (c) 2009 Joshua Elsasser <josh%elsasser.org@localhost>
diff -r c22ea56507fc -r bc80bb7b8766 external/bsd/tmux/dist/cfg.c
--- a/external/bsd/tmux/dist/cfg.c      Wed Aug 17 18:37:59 2011 +0000
+++ b/external/bsd/tmux/dist/cfg.c      Wed Aug 17 18:40:03 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: cfg.c,v 1.1.1.1 2011/03/10 09:15:36 jmmv Exp $ */
+/* $Id: cfg.c,v 1.1.1.2 2011/08/17 18:40:04 jmmv Exp $ */
 
 /*
  * Copyright (c) 2008 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -80,6 +80,7 @@
        size_t           len;
        struct cmd_list *cmdlist;
        struct cmd_ctx   ctx;
+       int              retval;
 
        if ((f = fopen(path, "rb")) == NULL) {
                cfg_add_cause(causes, "%s: %s", path, strerror(errno));
@@ -88,6 +89,7 @@
        n = 0;
 
        line = NULL;
+       retval = 0;
        while ((buf = fgetln(f, &len))) {
                if (buf[len - 1] == '\n')
                        buf[len - 1] = '\0';
@@ -125,19 +127,17 @@
                ctx.info = cfg_print;
 
                cfg_cause = NULL;
-               cmd_list_exec(cmdlist, &ctx);
+               if (cmd_list_exec(cmdlist, &ctx) == 1)
+                       retval = 1;
                cmd_list_free(cmdlist);
                if (cfg_cause != NULL) {
                        cfg_add_cause(causes, "%s: %d: %s", path, n, cfg_cause);
                        xfree(cfg_cause);
-                       continue;
                }
        }
        if (line != NULL)
                xfree(line);
        fclose(f);
 
-       if (ARRAY_LENGTH(causes) != 0)
-               return (-1);
-       return (0);
+       return (retval);
 }
diff -r c22ea56507fc -r bc80bb7b8766 external/bsd/tmux/dist/client.c
--- a/external/bsd/tmux/dist/client.c   Wed Aug 17 18:37:59 2011 +0000
+++ b/external/bsd/tmux/dist/client.c   Wed Aug 17 18:40:03 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.1.1.1 2011/03/10 09:15:36 jmmv Exp $ */
+/* $Id: client.c,v 1.1.1.2 2011/08/17 18:40:04 jmmv Exp $ */
 
 /*



Home | Main Index | Thread Index | Old Index