mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Trim.
This commit is contained in:
		
							
								
								
									
										6
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								cmd.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: cmd.c,v 1.64 2008-09-25 23:28:15 nicm Exp $ */
 | 
			
		||||
/* $Id: cmd.c,v 1.65 2008-09-26 06:45:26 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -93,13 +93,13 @@ cmd_complete(const char *s)
 | 
			
		||||
			continue;
 | 
			
		||||
		ARRAY_ADD(&list, (*entryp)->name);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	/* If none, bail now with the original string. */
 | 
			
		||||
	if (ARRAY_LENGTH(&list) == 0) {
 | 
			
		||||
		ARRAY_FREE(&list);
 | 
			
		||||
		return (xstrdup(s));
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	/* If an exact match, return it, with a trailing space. */
 | 
			
		||||
	if (ARRAY_LENGTH(&list) == 1) {
 | 
			
		||||
		xasprintf(&s2, "%s ", ARRAY_FIRST(&list));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user