A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-checkins/2002-October/030221.html below:

[Python-checkins] distutils/misc install.c,1.17,1.18

[Python-checkins] distutils/misc install.c,1.17,1.18theller@users.sourceforge.net theller@users.sourceforge.net
Tue, 15 Oct 2002 08:11:47 -0700
Update of /cvsroot/python/distutils/misc
In directory usw-pr-cvs1:/tmp/cvs-serv15222

Modified Files:
	install.c 
Log Message:
We have to check the return value of RegOpen* and RegQuery* functions,
otherwise we may display nonexisting Python versions.


Index: install.c
===================================================================
RCS file: /cvsroot/python/distutils/misc/install.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** install.c	20 Mar 2002 14:37:25 -0000	1.17
--- install.c	15 Oct 2002 15:11:45 -0000	1.18
***************
*** 1132,1147 ****
  	wsprintf (vers_name, "Python Version %s (found in registry)",
  		  core_version);
- 	itemindex = SendMessage (hwnd, LB_ADDSTRING, 0,
- 				 (LPARAM)(LPSTR)vers_name);
  	wsprintf (subkey_name,
  		  "Software\\Python\\PythonCore\\%s\\InstallPath",
  		  core_version);
  	value_size = sizeof (subkey_name);
! 	RegOpenKeyEx (hkRoot, subkey_name, 0, KEY_READ, &hk);
! 	RegQueryValueEx (hk, NULL, NULL, NULL, prefix_buf,
! 			 &value_size);
! 	RegCloseKey (hk);
! 	SendMessage (hwnd, LB_SETITEMDATA, itemindex,
! 		     (LPARAM)(LPSTR)strdup (prefix_buf));
      }
      RegCloseKey (hKey);
--- 1132,1149 ----
  	wsprintf (vers_name, "Python Version %s (found in registry)",
  		  core_version);
  	wsprintf (subkey_name,
  		  "Software\\Python\\PythonCore\\%s\\InstallPath",
  		  core_version);
  	value_size = sizeof (subkey_name);
! 	if (ERROR_SUCCESS == RegOpenKeyEx(hkRoot, subkey_name, 0, KEY_READ, &hk)) {
! 	    if (ERROR_SUCCESS == RegQueryValueEx(hk, NULL, NULL, NULL, prefix_buf,
! 						 &value_size)) {
! 		itemindex = SendMessage (hwnd, LB_ADDSTRING, 0,
! 				 (LPARAM)(LPSTR)vers_name);
! 		SendMessage (hwnd, LB_SETITEMDATA, itemindex,
! 			     (LPARAM)(LPSTR)strdup (prefix_buf));
! 	    }
! 	    RegCloseKey(hk);
! 	}
      }
      RegCloseKey (hKey);





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4