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 CHANGES FROM 1.9 to 1.9a 22 February ...



details:   https://anonhg.NetBSD.org/src/rev/8dcbc0cd3ab5
branches:  trunk
changeset: 797613:8dcbc0cd3ab5
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jul 24 14:22:49 2014 +0000

description:
CHANGES FROM 1.9 to 1.9a 22 February 2014

NOTE:  This is a bug-fix release to address some important bugs which just
missed the 1.9 deadline, but were found afterwards.

Normal Changes
==============

* Fix crash due to uninitialized lastwp member of layout_cell
* Fix -fg/-bg/-style with 256 colour terminals.

CHANGES FROM 1.8 to 1.9, 20 February 2014

NOTE:  This release has bumped the tmux protocol version.  It is therefore
advised that the prior tmux server is restarted when this version of tmux is
installed, to avoid protocol mismatch errors for newer clients trying to
talk to an older running tmux server.

Incompatible Changes
====================

* 88 colour support has been removed.
* 'default-path' has been removed.  The new-window command accepts '-c' to
  cater for this.  The previous value of "." can be replaced with: 'neww -c
  $PWD', the previous value of '' which meant current path of the pane can
  be specified as:  'neww -c "#{pane_current_path}"'

Deprecated Changes
==================

* The single format specifiers:  #A -> #Z (where defined) have been
  deprecated and replaced with longer-named equivalents, as listed in the
  FORMATS section of the tmux manpage.
* The various foo-{fg,bg,attr} commands have been deprecated and replaced
  with equivalent foo-style option instead.  Currently this is still
  backwards-compatible, but will be removed over time.

Normal Changes
==============

* A new environment variable TMUX_TMPDIR is now honoured, allowing the
  socket directory to be set outside of TMPDIR (/tmp/ if not set).
* If -s not given to swap-pane the current pane is assumed.
* A #{pane_syncronized} format specifier has been added to be a conditional
  format if a pane is in a syncronised mode (c.f. syncronize-panes)
* Tmux now runs under Cygwin natively.
* Formats can now be nested within each other and expanded accordingly.
* Added 'automatic-rename-format' option to allow the automatic rename
  mechanism to use something other than the default of
  #{pane_current_command}.
* new-session learnt '-c' to specify the starting directory for that session
  and all subsequent windows therein.
* The session name is now shown in the message printed to the terminal when
  a session is detached.
* Lots more format specifiers have been added.
* Server race conditions have been fixed; in particular commands are not run
  until after the configuration file is read completely.
* Case insensitive searching in tmux's copy-mode is now possible.
* attach-session and switch-client learnt the '-t' option to accept a window
  and/or a pane to use.
* Copy-mode is only exited if no selection is in progress.
* Paste key in copy-mode is now possible to enter text from the clipboard.
* status-interval set to '0' now works as intended.
* tmux now supports 256 colours running under fbterm.
* Many bug fixes!

CHANGES FROM 1.7 to 1.8, 26 March 2013

Incompatible Changes
====================

* layout redo/undo has been removed.

Normal Changes
==============

* Add halfpage up/down bindings to copy mode.
* Session choosing fixed to work with unattached sessions.
* New window options window-status-last-{attr,bg,fg} to denote the last
  window which was active.
* Scrolling in copy-mode now scrolls the region without moving the mouse
  cursor.
* run-shell learnt '-t' to specify the pane to use when displaying output.
* Support for middle-click pasting.
* choose-tree learns '-u' to start uncollapsed.
* select-window learnt '-T' to toggle to the last window if it's already
  current.
* New session option 'assume-paste-time' for pasting text versus key-binding
  actions.
* choose-* commands now work outside of an attached client.
* Aliases are now shown for list-commands command.
* Status learns about formats.
* Free-form options can be set with set-option if prepended with an '@'
  sign.
* capture-pane learnt '-p' to send to stdout, and '-e' for capturing escape
  sequences, and '-a' to capture the alternate screen, and '-P' to dump
  pending output.
* Many new formats added (client_session, client_last_session, etc.)
* Control mode, which is a way for a client to send tmux commands.
  Currently more useful to users of iterm2.
* resize-pane learnt '-x' and '-y' for absolute pane sizing.
* Config file loading now reports errors from all files which are loaded via
  the 'source-file' command.
* 'copy-pipe' mode command to copy selection and pipe the selection to a
  command.
* Panes can now emit focus notifications for certain applications
  which use those.
* run-shell and if-shell now accept formats.
* resize-pane learnt '-Z' for zooming a pane temporarily.
* new-session learnt '-A' to make it behave like attach-session.
* set-option learnt '-o' to prevent setting an option which is already set.
* capture-pane and show-options learns '-q' to silence errors.
* New command 'wait-for' which blocks a client until woken up again.
* Resizing panes will now reflow the text inside them.
* Lots and lots of bug fixes, fixing memory-leaks, etc.
* Various manpage improvements.

CHANGES FROM 1.6 to 1.7, 13 October 2012

* tmux configuration files now support line-continuation with a "\" at the
  end of a line.
* New option status-position to move the status line to the top or bottom of
  the screen.
* Enforce history-limit option when clearing the screen.
* Give each window a unique id, like panes but prefixed with @.
* Add pane id to each pane in layout description (while still accepting
  the old form).
* Provide defined ways to set the various default-path possibilities: ~
  for home directory, . for server start directory, - for session start
  directory and empty for the pane's working directory (the default). All
  can also be used as part of a relative path (eg -/foo). Also provide -c
  flags to neww and splitw to override default-path setting.
* Add -l flag to send-keys to send input literally (without translating
  key names).
* Allow a single option to be specified to show-options to show just that
  option.
* New command "move-pane" (like join-pane but allows the same window).
* join-pane and move-pane commands learn "-b" option to place the pane to
  the left or above.
* Support for bracketed-paste mode.
* Allow send-keys command to accept hex values.
* Add locking around "start-server" to avoid race-conditions.
* break-pane learns -P/-F arguments for display formatting.
* set-option learns "-q" to make it quiet, and not print out anything.
* copy mode learns "wrap-search" option.
* Add a simple form of output rate limiting by counting the number of
  certain C0 sequences (linefeeds, backspaces, carriage returns) and if it
  exceeds a threshold (current default 250/millisecond), start to redraw
  the pane every 100 milliseconds instead of making each change as it
  comes. Two configuration options - c0-change-trigger and
  c0-change-interval.
* find-window learns new flags:  "-C", "-N", "-T" to match against either or
  all of a window's content, name, or title.  Defaults to all three options
  if none specified.
* find-window automatically selects the appropriate pane for the found
  matches.
* show-environment can now accept one option to show that environment value.
* Exit mouse mode when end-of-screen reached when scrolling with the mouse
  wheel.
* select-layout learns -u and -U for layout history stacks.
* kill-window, detach-client, kill-session all  learn "-a" option for
  killing all but the current thing specified.
* move-window learns "-r" option to renumber window sequentially in a
  session.
* New session option "renumber-windows" to automatically renumber windows in
  a session when a window is closed.  (see "move-window -r").
* Only enter copy-mode on scroll up.
* choose-* and list-* commands all use "-F" for format specifiers.
* When spawning external commands, the value from the "default-shell" option
  is now used, rather than assuming /bin/sh.
* New choose-tree command to render window/sessions as a tree for selection.
* display-message learns new format options.
* For linked-windows across sessions, all flags for that window are now
  cleared across sessions.
* Lots and lots of bug fixes, fixing memory-leaks, etc.
* Various manpage improvements.

CHANGES FROM 1.5 TO 1.6, 23 January 2012

* Extend the mode-mouse option to add a third choice which means the mouse
  does not enter copy mode.
* Add a -r flag to switch-client to toggle the client read-only flag.
* Add pane-base-index option.
* Support \ for line continuation in the configuration file.
* Framework for more powerful formatting of command output and use it for
  list-{panes,windows,sessions}. This allows more descriptive replacements
  (such as #{session_name}) and conditionals.
* Mark dead panes with some text saying they are dead.
* Reject $SHELL if it is not a full path.
* Add -S option to refresh-client to redraw status line.
* Add an else clause for if-shell.
* Try to resolve relative paths for loadb and saveb (first, using client
  working directory, if any, then default-path or session working directory).
* Support for \e[3J to clear the history and send the corresponding
  terminfo code (E3) before locking.
* When in copy mode, make repeat count indicate buffer to replace, if used.
* Add screen*:XT to terminal-overrides for tmux-in-tmux.
* Status-line message attributes added.
* Move word-separators to be a session rather than window option.
* Change the way the working directory for new processes is discovered. If
  default-path isn't empty, it is used. Otherwise, if a new window is created
  from the command-line, the working directory of the client is used. If not,
  platform specific code is used to retrieve the current working directory
  of the process in the active pane. If that fails, the directory where the
  session was created is used, instead.
* Do not change the current pane if both mouse-select-{pane,window} are
  enabled.
* Add \033[s and \033[u to save and restore cursor position.
* Allow $HOME to be used as default-path.
* Add CNL and CPL escape sequences.
* Calculate last position correctly for UTF-8 wide characters.
* Add an option allow-rename to disable the window rename escape sequence.
* Attributes for each type of status-line alert (ie bell, content and
  activity) added. Therefore, remove the superfluous options
  window-status-alert-{attr,bg,fg}.
* Add a -R flag to send-keys to reset the terminal.
* Add strings to allow the aixterm bright colours to be used when
  configuring colours.
* Drop the ability to have a list of keys in the prefix in favour of two
  separate options, prefix and prefix2.
* Flag -2 added to send-prefix to send the secondary prefix key.
* Show pane size in top right of display panes mode.
* Some memory leaks plugged.
* More command-prompt editing improvements.
* Various manpage improvements.
* More Vi mode improvements.

diffstat:

 external/bsd/tmux/dist/arguments.c               |  125 ++-
 external/bsd/tmux/dist/array.h                   |    7 +-
 external/bsd/tmux/dist/attributes.c              |   30 +-
 external/bsd/tmux/dist/cfg.c                     |  203 +++--
 external/bsd/tmux/dist/client.c                  |  440 ++++++++---
 external/bsd/tmux/dist/clock.c                   |   17 +-
 external/bsd/tmux/dist/cmd-attach-session.c      |  175 +++-
 external/bsd/tmux/dist/cmd-bind-key.c            |   97 +-
 external/bsd/tmux/dist/cmd-break-pane.c          |   53 +-
 external/bsd/tmux/dist/cmd-capture-pane.c        |  202 ++++-
 external/bsd/tmux/dist/cmd-choose-buffer.c       |  126 +--
 external/bsd/tmux/dist/cmd-choose-client.c       |  131 +--
 external/bsd/tmux/dist/cmd-choose-list.c         |   97 ++
 external/bsd/tmux/dist/cmd-choose-tree.c         |  235 ++++++
 external/bsd/tmux/dist/cmd-clear-history.c       |   15 +-
 external/bsd/tmux/dist/cmd-clock-mode.c          |   15 +-
 external/bsd/tmux/dist/cmd-command-prompt.c      |   52 +-
 external/bsd/tmux/dist/cmd-confirm-before.c      |   72 +-
 external/bsd/tmux/dist/cmd-copy-mode.c           |   25 +-
 external/bsd/tmux/dist/cmd-delete-buffer.c       |   23 +-
 external/bsd/tmux/dist/cmd-detach-client.c       |   52 +-
 external/bsd/tmux/dist/cmd-display-panes.c       |   15 +-
 external/bsd/tmux/dist/cmd-find-window.c         |  241 ++++--
 external/bsd/tmux/dist/cmd-has-session.c         |   15 +-
 external/bsd/tmux/dist/cmd-join-pane.c           |   78 +-
 external/bsd/tmux/dist/cmd-kill-pane.c           |   33 +-
 external/bsd/tmux/dist/cmd-kill-server.c         |   22 +-
 external/bsd/tmux/dist/cmd-kill-session.c        |   35 +-
 external/bsd/tmux/dist/cmd-kill-window.c         |   32 +-
 external/bsd/tmux/dist/cmd-link-window.c         |   25 +-
 external/bsd/tmux/dist/cmd-list-buffers.c        |   38 +-
 external/bsd/tmux/dist/cmd-list-clients.c        |   57 +-
 external/bsd/tmux/dist/cmd-list-commands.c       |   23 +-
 external/bsd/tmux/dist/cmd-list-keys.c           |   45 +-
 external/bsd/tmux/dist/cmd-list-panes.c          |  132 +-
 external/bsd/tmux/dist/cmd-list-sessions.c       |   51 +-
 external/bsd/tmux/dist/cmd-list-windows.c        |   82 +-
 external/bsd/tmux/dist/cmd-list.c                |   61 +-
 external/bsd/tmux/dist/cmd-load-buffer.c         |  121 +-
 external/bsd/tmux/dist/cmd-lock-server.c         |   24 +-
 external/bsd/tmux/dist/cmd-move-window.c         |   41 +-
 external/bsd/tmux/dist/cmd-new-session.c         |  266 +++---
 external/bsd/tmux/dist/cmd-new-window.c          |  122 ++-
 external/bsd/tmux/dist/cmd-pipe-pane.c           |   34 +-
 external/bsd/tmux/dist/cmd-queue.c               |  281 +++++++
 external/bsd/tmux/dist/cmd-refresh-client.c      |   47 +-
 external/bsd/tmux/dist/cmd-rename-session.c      |   26 +-
 external/bsd/tmux/dist/cmd-rename-window.c       |   18 +-
 external/bsd/tmux/dist/cmd-resize-pane.c         |   65 +-
 external/bsd/tmux/dist/cmd-respawn-pane.c        |   35 +-
 external/bsd/tmux/dist/cmd-respawn-window.c      |   30 +-
 external/bsd/tmux/dist/cmd-rotate-window.c       |   17 +-
 external/bsd/tmux/dist/cmd-run-shell.c           |  121 ++-
 external/bsd/tmux/dist/cmd-save-buffer.c         |  142 ++-
 external/bsd/tmux/dist/cmd-select-layout.c       |   39 +-
 external/bsd/tmux/dist/cmd-select-pane.c         |   38 +-
 external/bsd/tmux/dist/cmd-select-window.c       |   52 +-
 external/bsd/tmux/dist/cmd-send-keys.c           |   58 +-
 external/bsd/tmux/dist/cmd-set-buffer.c          |   30 +-
 external/bsd/tmux/dist/cmd-set-environment.c     |   37 +-
 external/bsd/tmux/dist/cmd-set-option.c          |  331 +++++---
 external/bsd/tmux/dist/cmd-show-environment.c    |   36 +-
 external/bsd/tmux/dist/cmd-show-messages.c       |  126 +++-
 external/bsd/tmux/dist/cmd-show-options.c        |  114 ++-
 external/bsd/tmux/dist/cmd-source-file.c         |  101 +-
 external/bsd/tmux/dist/cmd-split-window.c        |  114 ++-
 external/bsd/tmux/dist/cmd-suspend-client.c      |   15 +-
 external/bsd/tmux/dist/cmd-swap-pane.c           |   33 +-
 external/bsd/tmux/dist/cmd-swap-window.c         |   25 +-
 external/bsd/tmux/dist/cmd-switch-client.c       |   89 +-
 external/bsd/tmux/dist/cmd-unbind-key.c          |   90 +-
 external/bsd/tmux/dist/cmd-unlink-window.c       |   19 +-
 external/bsd/tmux/dist/cmd-wait-for.c            |  196 +++++
 external/bsd/tmux/dist/cmd.c                     |  334 +++++---
 external/bsd/tmux/dist/compat.h                  |   39 +-
 external/bsd/tmux/dist/compat/b64_ntop.c         |  182 +++++
 external/bsd/tmux/dist/compat/cfmakeraw.c        |   32 +
 external/bsd/tmux/dist/compat/imsg.h             |    2 +-
 external/bsd/tmux/dist/compat/openat.c           |   63 +
 external/bsd/tmux/dist/compat/strtonum.c         |    2 +-
 external/bsd/tmux/dist/control-notify.c          |  203 +++++
 external/bsd/tmux/dist/control.c                 |   90 ++
 external/bsd/tmux/dist/examples/screen-keys.conf |    8 +-
 external/bsd/tmux/dist/examples/tmux.vim         |  306 ++++++-
 external/bsd/tmux/dist/examples/xterm-keys.vim   |   51 +
 external/bsd/tmux/dist/format.c                  |  616 +++++++++++++++++
 external/bsd/tmux/dist/grid-cell.c               |   55 +
 external/bsd/tmux/dist/grid-view.c               |   32 +-
 external/bsd/tmux/dist/grid.c                    |  485 ++++++++++--
 external/bsd/tmux/dist/key-bindings.c            |   97 +--
 external/bsd/tmux/dist/key-string.c              |   26 +-
 external/bsd/tmux/dist/layout-custom.c           |   24 +-
 external/bsd/tmux/dist/layout-set.c              |    6 +-
 external/bsd/tmux/dist/layout.c                  |  124 ++-
 external/bsd/tmux/dist/mdoc2man.awk              |  370 ++++++++++
 external/bsd/tmux/dist/mode-key.c                |  518 ++++++++-----
 external/bsd/tmux/dist/names.c                   |   75 +-
 external/bsd/tmux/dist/notify.c                  |  208 +++++
 external/bsd/tmux/dist/options-table.c           |  407 +++++++++-
 external/bsd/tmux/dist/osdep-aix.c               |    8 +-
 external/bsd/tmux/dist/osdep-darwin.c            |   41 +-
 external/bsd/tmux/dist/osdep-dragonfly.c         |  133 +++
 external/bsd/tmux/dist/osdep-freebsd.c           |   30 +-
 external/bsd/tmux/dist/osdep-hpux.c              |    8 +-
 external/bsd/tmux/dist/osdep-linux.c             |   38 +-
 external/bsd/tmux/dist/osdep-netbsd.c            |    9 +-
 external/bsd/tmux/dist/osdep-openbsd.c           |   18 +-
 external/bsd/tmux/dist/osdep-sunos.c             |   30 +-
 external/bsd/tmux/dist/osdep-unknown.c           |    8 +-
 external/bsd/tmux/dist/paste.c                   |   53 +-
 external/bsd/tmux/dist/resize.c                  |   40 +-
 external/bsd/tmux/dist/screen-redraw.c           |  249 ++++--
 external/bsd/tmux/dist/server-client.c           |  814 ++++++++++++----------
 external/bsd/tmux/dist/server-window.c           |   86 +-
 external/bsd/tmux/dist/server.c                  |  106 +-
 external/bsd/tmux/dist/signal.c                  |    2 +-
 external/bsd/tmux/dist/status.c                  |  406 ++++++----
 external/bsd/tmux/dist/style.c                   |  238 ++++++
 external/bsd/tmux/dist/tty.c                     |  491 +++++++------
 external/bsd/tmux/dist/utf8.c                    |    5 +-
 external/bsd/tmux/dist/window-choose.c           |  640 ++++++++++++++++--
 external/bsd/tmux/dist/window-clock.c            |    8 +-
 external/bsd/tmux/dist/xmalloc.c                 |   10 +-
 external/bsd/tmux/dist/xterm-keys.c              |   36 +-
 124 files changed, 10036 insertions(+), 3936 deletions(-)

diffs (truncated from 21596 to 300 lines):

diff -r 0c8c54f53878 -r 8dcbc0cd3ab5 external/bsd/tmux/dist/arguments.c
--- a/external/bsd/tmux/dist/arguments.c        Thu Jul 24 14:09:09 2014 +0000
+++ b/external/bsd/tmux/dist/arguments.c        Thu Jul 24 14:22:49 2014 +0000
@@ -1,4 +1,4 @@
-/* $Id: arguments.c,v 1.1.1.1 2011/08/17 18:40:04 jmmv Exp $ */
+/* $Id: arguments.c,v 1.1.1.2 2014/07/24 14:22:52 christos Exp $ */
 
 /*
  * Copyright (c) 2010 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -20,9 +20,25 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #include "tmux.h"
 
+/*
+ * Manipulate command arguments.
+ */
+
+struct args_entry      *args_find(struct args *, u_char);
+
+RB_GENERATE(args_tree, args_entry, entry, args_cmp);
+
+/* Arguments tree comparison function. */
+int
+args_cmp(struct args_entry *a1, struct args_entry *a2)
+{
+       return (a1->flag - a2->flag);
+}
+
 /* Create an arguments set with no flags. */
 struct args *
 args_create(int argc, ...)
@@ -32,8 +48,6 @@
        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)
@@ -49,36 +63,36 @@
        return (args);
 }
 
+/* Find a flag in the arguments tree. */
+struct args_entry *
+args_find(struct args *args, u_char ch)
+{
+       struct args_entry       entry;
+
+       entry.flag = ch;
+       return (RB_FIND(args_tree, &args->tree, &entry));
+}
+
 /* 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)
+               if (opt < 0)
                        continue;
-               if (opt == '?' || (ptr = strchr(template, opt)) == NULL) {
-                       xfree(args->flags);
-                       xfree(args);
+               if (opt == '?' || strchr(template, opt) == NULL) {
+                       args_free(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);
-               }
+               args_set(args, opt, optarg);
        }
        argc -= optind;
        argv += optind;
@@ -93,26 +107,28 @@
 void
 args_free(struct args *args)
 {
-       u_int   i;
+       struct args_entry       *entry;
+       struct args_entry       *entry1;
 
        cmd_free_argv(args->argc, args->argv);
 
-       for (i = 0; i < SCHAR_MAX; i++) {
-               if (args->values[i] != NULL)
-                       xfree(args->values[i]);
+       RB_FOREACH_SAFE(entry, args_tree, &args->tree, entry1) {
+               RB_REMOVE(args_tree, &args->tree, entry);
+               free(entry->value);
+               free(entry);
        }
 
-       xfree(args->flags);
-       xfree(args);
+       free(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;
+       size_t                   off;
+       int                      i;
+       const char              *quotes;
+       struct args_entry       *entry;
 
        /* There must be at least one byte at the start. */
        if (len == 0)
@@ -121,23 +137,23 @@
 
        /* Process the flags first. */
        buf[off++] = '-';
-       for (i = 0; i < SCHAR_MAX; i++) {
-               if (!bit_test(args->flags, i) || args->values[i] != NULL)
+       RB_FOREACH(entry, args_tree, &args->tree) {
+               if (entry->value != NULL)
                        continue;
 
                if (off == len - 1) {
                        buf[off] = '\0';
                        return (len);
                }
-               buf[off++] = i;
+               buf[off++] = entry->flag;
                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)
+       RB_FOREACH(entry, args_tree, &args->tree) {
+               if (entry->value == NULL)
                        continue;
 
                if (off >= len) {
@@ -145,12 +161,13 @@
                        return (len);
                }
 
-               if (strchr(args->values[i], ' ') != NULL)
+               if (strchr(entry->value, ' ') != NULL)
                        quotes = "\"";
                else
                        quotes = "";
                off += xsnprintf(buf + off, len - off, "%s-%c %s%s%s",
-                   off != 0 ? " " : "", i, quotes, args->values[i], quotes);
+                   off != 0 ? " " : "", entry->flag, quotes, entry->value,
+                   quotes);
        }
 
        /* And finally the argument vector. */
@@ -175,43 +192,55 @@
 int
 args_has(struct args *args, u_char ch)
 {
-       return (bit_test(args->flags, ch));
+       return (args_find(args, ch) == NULL ? 0 : 1);
 }
 
-/* Set argument value. */
+/* Set argument value in the arguments tree. */
 void
 args_set(struct args *args, u_char ch, const char *value)
 {
-       if (args->values[ch] != NULL)
-               xfree(args->values[ch]);
+       struct args_entry       *entry;
+
+       /* Replace existing argument. */
+       if ((entry = args_find(args, ch)) != NULL) {
+               free(entry->value);
+               entry->value = NULL;
+       } else {
+               entry = xcalloc(1, sizeof *entry);
+               entry->flag = ch;
+               RB_INSERT(args_tree, &args->tree, entry);
+       }
+
        if (value != NULL)
-               args->values[ch] = xstrdup(value);
-       else
-               args->values[ch] = NULL;
-       bit_set(args->flags, ch);
+               entry->value = xstrdup(value);
 }
 
 /* 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]);
+       struct args_entry       *entry;
+
+       if ((entry = args_find(args, ch)) == NULL)
+               return (NULL);
+       return (entry->value);
 }
 
 /* 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)
+args_strtonum(struct args *args, u_char ch, long long minval, long long maxval,
+    char **cause)
 {
-       const char      *errstr;
-       long long        ll;
+       const char              *errstr;
+       long long                ll;
+       struct args_entry       *entry;
 
-       if (!args_has(args, ch)) {
+       if ((entry = args_find(args, ch)) == NULL) {
                *cause = xstrdup("missing");
                return (0);
        }
 
-       ll = strtonum(args->values[ch], minval, maxval, &errstr);
+       ll = strtonum(entry->value, minval, maxval, &errstr);
        if (errstr != NULL) {
                *cause = xstrdup(errstr);
                return (0);
diff -r 0c8c54f53878 -r 8dcbc0cd3ab5 external/bsd/tmux/dist/array.h
--- a/external/bsd/tmux/dist/array.h    Thu Jul 24 14:09:09 2014 +0000
+++ b/external/bsd/tmux/dist/array.h    Thu Jul 24 14:22:49 2014 +0000
@@ -1,4 +1,4 @@
-/* $Id: array.h,v 1.1.1.2 2011/08/17 18:40:05 jmmv Exp $ */
+/* $Id: array.h,v 1.1.1.3 2014/07/24 14:22:51 christos Exp $ */
 
 /*
  * Copyright (c) 2006 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -109,13 +109,12 @@
 } while (0)
 
 #define ARRAY_FREE(a) do {                                             \
-       if ((a)->list != NULL)                                          \
-               xfree((a)->list);                                       \
+       free((a)->list);                                                \
        ARRAY_INIT(a);                                                  \
 } while (0)
 #define ARRAY_FREEALL(a) do {                                          \
        ARRAY_FREE(a);                                                  \
-       xfree(a);                                                       \
+       free(a);                                                        \
 } while (0)
 
 #endif
diff -r 0c8c54f53878 -r 8dcbc0cd3ab5 external/bsd/tmux/dist/attributes.c
--- a/external/bsd/tmux/dist/attributes.c       Thu Jul 24 14:09:09 2014 +0000
+++ b/external/bsd/tmux/dist/attributes.c       Thu Jul 24 14:22:49 2014 +0000
@@ -1,4 +1,4 @@
-/* $Id: attributes.c,v 1.1.1.2 2011/08/17 18:40:04 jmmv Exp $ */
+/* $Id: attributes.c,v 1.1.1.3 2014/07/24 14:22:51 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Joshua Elsasser <josh%elsasser.org@localhost>
@@ -26,27 +26,21 @@
 attributes_tostring(u_char attr)
 {
        static char     buf[128];
+       size_t          len;
 
        if (attr == 0)
                return ("none");
 
-       buf[0] = '\0';
-       if (attr & GRID_ATTR_BRIGHT)
-               strlcat(buf, "bright,", sizeof (buf));
-       if (attr & GRID_ATTR_DIM)
-               strlcat(buf, "dim,", sizeof (buf));
-       if (attr & GRID_ATTR_UNDERSCORE)
-               strlcat(buf, "underscore,", sizeof (buf));
-       if (attr & GRID_ATTR_BLINK)



Home | Main Index | Thread Index | Old Index