mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Handle exact match properly.
This commit is contained in:
		
							
								
								
									
										6
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								CHANGES
									
									
									
									
									
								
							@@ -1,3 +1,7 @@
 | 
			
		||||
19 July 2008
 | 
			
		||||
 | 
			
		||||
* Unbreak "set status" - tmux thought it was ambiguous, reported by rivo nurges.
 | 
			
		||||
 | 
			
		||||
02 July 2008
 | 
			
		||||
 | 
			
		||||
* Split vi and emacs mode keys into two tables and add an option (mode-keys)
 | 
			
		||||
@@ -610,4 +614,4 @@
 | 
			
		||||
  (including mutt, emacs). No status bar yet and no key remapping or other
 | 
			
		||||
  customisation.
 | 
			
		||||
 | 
			
		||||
$Id: CHANGES,v 1.149 2008-07-02 21:22:57 nicm Exp $
 | 
			
		||||
$Id: CHANGES,v 1.150 2008-07-19 10:07:50 nicm Exp $
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: cmd-set-option.c,v 1.39 2008-07-02 21:22:57 nicm Exp $ */
 | 
			
		||||
/* $Id: cmd-set-option.c,v 1.40 2008-07-19 10:07:50 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -168,6 +168,9 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
			
		||||
		}
 | 
			
		||||
		entry = &set_option_table[i];
 | 
			
		||||
 | 
			
		||||
		/* Bail now if an exact match. */
 | 
			
		||||
		if (strcmp(entry->name, data->option) == 0)
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
	if (entry == NULL) {
 | 
			
		||||
		ctx->error(ctx, "unknown option: %s", data->option);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								cmd.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: cmd.c,v 1.61 2008-07-01 20:35:16 nicm Exp $ */
 | 
			
		||||
/* $Id: cmd.c,v 1.62 2008-07-19 10:07:50 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -150,6 +150,10 @@ cmd_parse(int argc, char **argv, char **cause)
 | 
			
		||||
		if (entry != NULL)
 | 
			
		||||
			goto ambiguous;
 | 
			
		||||
		entry = *entryp;
 | 
			
		||||
 | 
			
		||||
		/* Bail now if an exact match. */
 | 
			
		||||
		if (strcmp(entry->name, argv[0]) == 0)
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
	if (entry == NULL) {
 | 
			
		||||
		xasprintf(cause, "unknown command: %s", argv[0]);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user