[BACK]Return to cmd-show-buffer.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/Attic/cmd-show-buffer.c between version 1.13 and 1.14

version 1.13, 2012/07/10 11:53:01 version 1.14, 2012/07/11 07:10:15
Line 27 
Line 27 
  * Show a paste buffer.   * Show a paste buffer.
  */   */
   
 int     cmd_show_buffer_exec(struct cmd *, struct cmd_ctx *);  enum cmd_retval  cmd_show_buffer_exec(struct cmd *, struct cmd_ctx *);
   
 const struct cmd_entry cmd_show_buffer_entry = {  const struct cmd_entry cmd_show_buffer_entry = {
         "show-buffer", "showb",          "show-buffer", "showb",
Line 39 
Line 39 
         cmd_show_buffer_exec          cmd_show_buffer_exec
 };  };
   
 int  enum cmd_retval
 cmd_show_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)  cmd_show_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
 {  {
         struct args             *args = self->args;          struct args             *args = self->args;
Line 51 
Line 51 
         u_int                    width;          u_int                    width;
   
         if ((s = cmd_find_session(ctx, NULL, 0)) == NULL)          if ((s = cmd_find_session(ctx, NULL, 0)) == NULL)
                 return (-1);                  return (CMD_RETURN_ERROR);
   
         if (!args_has(args, 'b')) {          if (!args_has(args, 'b')) {
                 if ((pb = paste_get_top(&global_buffers)) == NULL) {                  if ((pb = paste_get_top(&global_buffers)) == NULL) {
                         ctx->error(ctx, "no buffers");                          ctx->error(ctx, "no buffers");
                         return (-1);                          return (CMD_RETURN_ERROR);
                 }                  }
         } else {          } else {
                 buffer = args_strtonum(args, 'b', 0, INT_MAX, &cause);                  buffer = args_strtonum(args, 'b', 0, INT_MAX, &cause);
                 if (cause != NULL) {                  if (cause != NULL) {
                         ctx->error(ctx, "buffer %s", cause);                          ctx->error(ctx, "buffer %s", cause);
                         free(cause);                          free(cause);
                         return (-1);                          return (CMD_RETURN_ERROR);
                 }                  }
   
                 pb = paste_get_index(&global_buffers, buffer);                  pb = paste_get_index(&global_buffers, buffer);
                 if (pb == NULL) {                  if (pb == NULL) {
                         ctx->error(ctx, "no buffer %d", buffer);                          ctx->error(ctx, "no buffer %d", buffer);
                         return (-1);                          return (CMD_RETURN_ERROR);
                 }                  }
         }          }
   
Line 108 
Line 108 
   
         free(in);          free(in);
   
         return (0);          return (CMD_RETURN_NORMAL);
 }  }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14