mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	If one match, add trailing space.
This commit is contained in:
		
							
								
								
									
										9
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								cmd.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: cmd.c,v 1.53 2008-06-21 14:11:39 nicm Exp $ */
 | 
			
		||||
/* $Id: cmd.c,v 1.54 2008-06-21 14:16:30 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -96,6 +96,13 @@ cmd_complete(const char *s)
 | 
			
		||||
		return (xstrdup(s));
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/* If an exact match, return it, with a trailing space. */
 | 
			
		||||
	if (ARRAY_LENGTH(&list) == 1) {
 | 
			
		||||
		xasprintf(&s, "%s ", ARRAY_FIRST(&list));
 | 
			
		||||
		ARRAY_FREE(&list);
 | 
			
		||||
		return (s);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Now loop through the list and find the longest common prefix. */
 | 
			
		||||
	prefix = xstrdup(ARRAY_FIRST(&list));
 | 
			
		||||
	for (i = 1; i < ARRAY_LENGTH(&list); i++) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user