mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		
							
								
								
									
										10
									
								
								cfg.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								cfg.c
									
									
									
									
									
								
							@@ -27,11 +27,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "tmux.h"
 | 
					#include "tmux.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
char			 *cfg_file;
 | 
					char		 *cfg_file;
 | 
				
			||||||
int			  cfg_finished;
 | 
					int		  cfg_finished;
 | 
				
			||||||
static char		**cfg_causes;
 | 
					static char	**cfg_causes;
 | 
				
			||||||
static u_int		  cfg_ncauses;
 | 
					static u_int	  cfg_ncauses;
 | 
				
			||||||
struct client		 *cfg_client;
 | 
					struct client	 *cfg_client;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static enum cmd_retval
 | 
					static enum cmd_retval
 | 
				
			||||||
cfg_done(__unused struct cmdq_item *item, __unused void *data)
 | 
					cfg_done(__unused struct cmdq_item *item, __unused void *data)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <sys/types.h>
 | 
					#include <sys/types.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <errno.h>
 | 
				
			||||||
 | 
					#include <glob.h>
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "tmux.h"
 | 
					#include "tmux.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -48,23 +51,30 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	struct client		*c = item->client;
 | 
						struct client		*c = item->client;
 | 
				
			||||||
	int			 quiet;
 | 
						int			 quiet;
 | 
				
			||||||
	struct cmdq_item	*new_item;
 | 
						struct cmdq_item	*new_item;
 | 
				
			||||||
 | 
						enum cmd_retval		 retval;
 | 
				
			||||||
 | 
						glob_t			 g;
 | 
				
			||||||
 | 
						int			 i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	quiet = args_has(args, 'q');
 | 
						quiet = args_has(args, 'q');
 | 
				
			||||||
	switch (load_cfg(args->argv[0], c, item, quiet)) {
 | 
						if (glob(args->argv[0], 0, NULL, &g) != 0) {
 | 
				
			||||||
	case -1:
 | 
							if (quiet && errno == ENOENT)
 | 
				
			||||||
		if (cfg_finished)
 | 
								return (CMD_RETURN_NORMAL);
 | 
				
			||||||
			cfg_print_causes(item);
 | 
							cmdq_error(item, "%s: %s", args->argv[0], strerror(errno));
 | 
				
			||||||
		return (CMD_RETURN_ERROR);
 | 
							return (CMD_RETURN_ERROR);
 | 
				
			||||||
	case 0:
 | 
						}
 | 
				
			||||||
		if (cfg_finished)
 | 
					
 | 
				
			||||||
			cfg_print_causes(item);
 | 
						retval = CMD_RETURN_NORMAL;
 | 
				
			||||||
		return (CMD_RETURN_NORMAL);
 | 
						for (i = 0; i < g.gl_pathc; i++) {
 | 
				
			||||||
 | 
							if (load_cfg(g.gl_pathv[i], c, item, quiet) != 0)
 | 
				
			||||||
 | 
								retval = CMD_RETURN_ERROR;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (cfg_finished) {
 | 
						if (cfg_finished) {
 | 
				
			||||||
		new_item = cmdq_get_callback(cmd_source_file_done, NULL);
 | 
							new_item = cmdq_get_callback(cmd_source_file_done, NULL);
 | 
				
			||||||
		cmdq_insert_after(item, new_item);
 | 
							cmdq_insert_after(item, new_item);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return (CMD_RETURN_NORMAL);
 | 
					
 | 
				
			||||||
 | 
						globfree(&g);
 | 
				
			||||||
 | 
						return (retval);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static enum cmd_retval
 | 
					static enum cmd_retval
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								tmux.1
									
									
									
									
									
								
							@@ -925,7 +925,10 @@ show debugging information about jobs and terminals.
 | 
				
			|||||||
.Xc
 | 
					.Xc
 | 
				
			||||||
.D1 (alias: Ic source )
 | 
					.D1 (alias: Ic source )
 | 
				
			||||||
Execute commands from
 | 
					Execute commands from
 | 
				
			||||||
.Ar path .
 | 
					.Ar path
 | 
				
			||||||
 | 
					(which may be a
 | 
				
			||||||
 | 
					.Xr glob 3
 | 
				
			||||||
 | 
					pattern).
 | 
				
			||||||
If
 | 
					If
 | 
				
			||||||
.Fl q
 | 
					.Fl q
 | 
				
			||||||
is given, no error will be returned if
 | 
					is given, no error will be returned if
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							@@ -78,7 +78,7 @@ struct tmuxproc;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define READ_CHANGE_HITS 3
 | 
					#define READ_CHANGE_HITS 3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Attribute to make gcc check printf-like arguments. */
 | 
					/* Attribute to make GCC check printf-like arguments. */
 | 
				
			||||||
#define printflike(a, b) __attribute__ ((format (printf, a, b)))
 | 
					#define printflike(a, b) __attribute__ ((format (printf, a, b)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Number of items in array. */
 | 
					/* Number of items in array. */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user