mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	conf: check for include path duplicates
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									39fda8a69a
								
							
						
					
					
						commit
						c28618353b
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		
							
								
								
									
										11
									
								
								src/conf.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/conf.c
									
										
									
									
									
								
							| 
						 | 
					@ -528,6 +528,17 @@ static inline void snd_config_unlock(void) { }
 | 
				
			||||||
static int add_include_path(struct filedesc *fd, const char *dir)
 | 
					static int add_include_path(struct filedesc *fd, const char *dir)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct include_path *path;
 | 
						struct include_path *path;
 | 
				
			||||||
 | 
						struct filedesc *fd1;
 | 
				
			||||||
 | 
						struct list_head *pos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* check, if dir is already registered (also in parents) */
 | 
				
			||||||
 | 
						for (fd1 = fd; fd1; fd1 = fd1->next) {
 | 
				
			||||||
 | 
							list_for_each(pos, &fd1->include_paths) {
 | 
				
			||||||
 | 
								path = list_entry(pos, struct include_path, list);
 | 
				
			||||||
 | 
								if (strcmp(path->dir, dir) == 0)
 | 
				
			||||||
 | 
									return 0;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	path = calloc(1, sizeof(*path));
 | 
						path = calloc(1, sizeof(*path));
 | 
				
			||||||
	if (!path)
 | 
						if (!path)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue