Browse Source

Bugfix: Restore case insensitivity to --scan driver names

Luke Dashjr 12 years ago
parent
commit
890a2fbbae
1 changed files with 7 additions and 1 deletions
  1. 7 1
      miner.c

+ 7 - 1
miner.c

@@ -10388,13 +10388,19 @@ bool _probe_device_match(const struct lowlevel_device_info * const info, const c
 }
 }
 
 
 static
 static
-const struct device_drv *_probe_device_find_drv(const char * const dname, const size_t dnamelen)
+const struct device_drv *_probe_device_find_drv(const char * const _dname, const size_t dnamelen)
 {
 {
 	struct driver_registration *dreg;
 	struct driver_registration *dreg;
+	char dname[dnamelen];
+	int i;
 	
 	
+	for (i = 0; i < dnamelen; ++i)
+		dname[i] = tolower(_dname[i]);
 	BFG_FIND_DRV_BY_DNAME(dreg, dname, dnamelen);
 	BFG_FIND_DRV_BY_DNAME(dreg, dname, dnamelen);
 	if (!dreg)
 	if (!dreg)
 	{
 	{
+		for (i = 0; i < dnamelen; ++i)
+			dname[i] = toupper(_dname[i]);
 		BFG_FIND_DRV_BY_NAME(dreg, dname, dnamelen);
 		BFG_FIND_DRV_BY_NAME(dreg, dname, dnamelen);
 		if (!dreg)
 		if (!dreg)
 			return NULL;
 			return NULL;