mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Treat the "GARMIN" mount point exactly like the "UEMISSDA" one
The logic for finding a mount point for the Garmin FIT devices is basically exactly the same as for the UEMISSDA, even if the rest of the sequence is not the same. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									cae30f450a
								
							
						
					
					
						commit
						bb067b6ee4
					
				
					 3 changed files with 5 additions and 2 deletions
				
			
		|  | @ -144,7 +144,8 @@ int enumerate_devices(device_callback_t callback, void *userdata, int dc_type) | |||
| 		} | ||||
| 
 | ||||
| 		while ((ep = readdir(dp)) != NULL) { | ||||
| 			if (fnmatch("UEMISSDA", ep->d_name, 0) == 0) { | ||||
| 			if (fnmatch("UEMISSDA", ep->d_name, 0) == 0 || | ||||
| 			    fnmatch("GARMIN", ep->d_name, 0) == 0) { | ||||
| 				char filename[1024]; | ||||
| 				int n = snprintf(filename, sizeof(filename), "%s/%s", dirname, ep->d_name); | ||||
| 				if (n >= (int)sizeof(filename)) { | ||||
|  |  | |||
|  | @ -161,6 +161,8 @@ int enumerate_devices(device_callback_t callback, void *userdata, int dc_type) | |||
| 
 | ||||
| 		while ((getline(&line, &len, file)) != -1) { | ||||
| 			char *ptr = strstr(line, "UEMISSDA"); | ||||
| 			if (!ptr) | ||||
| 				ptr = strstr(line, "GARMIN"); | ||||
| 			if (ptr) { | ||||
| 				char *end = ptr, *start = ptr; | ||||
| 				while (start > line && *start != ' ') | ||||
|  |  | |||
|  | @ -173,7 +173,7 @@ int enumerate_devices(device_callback_t callback, void *userdata, int dc_type) | |||
| 		int i; | ||||
| 		int count_drives = 0; | ||||
| 		const int bufdef = 512; | ||||
| 		const char *dlabels[] = {"UEMISSDA", NULL}; | ||||
| 		const char *dlabels[] = {"UEMISSDA", "GARMIN", NULL}; | ||||
| 		char bufname[bufdef], bufval[bufdef], *p; | ||||
| 		DWORD bufname_len; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue