[Python-checkins] python/dist/src/Modules posixmodule.c,2.295,2.296

aimacintyre@users.sourceforge.net aimacintyre@users.sourceforge.net
Mon, 21 Apr 2003 07:19:55 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv20011

Modified Files:
	posixmodule.c 
Log Message:
- DosSetExtLIBPATH objects to a NULL pointer, but a pointer to a NULL 
  string does what is expected (ie unset [BEGIN|END]LIBPATH)

- set the size of the DosQuerySysInfo buffer correctly; it was safe, 
  but incorrect (allowing a 1 element overrun)


Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.295
retrieving revision 2.296
diff -C2 -d -r2.295 -r2.296
*** posixmodule.c	19 Apr 2003 15:41:47 -0000	2.295
--- posixmodule.c	21 Apr 2003 14:19:51 -0000	2.296
***************
*** 5411,5417 ****
          APIRET rc;
  
-         if (strlen(s2) == 0)  /* If New Value is an Empty String */
-             s2 = NULL;        /* Then OS/2 API Wants a NULL to Undefine It */
- 
          rc = DosSetExtLIBPATH(s2, BEGIN_LIBPATH);
          if (rc != NO_ERROR)
--- 5411,5414 ----
***************
*** 5421,5427 ****
          APIRET rc;
  
-         if (strlen(s2) == 0)  /* If New Value is an Empty String */
-             s2 = NULL;        /* Then OS/2 API Wants a NULL to Undefine It */
- 
          rc = DosSetExtLIBPATH(s2, END_LIBPATH);
          if (rc != NO_ERROR)
--- 5418,5421 ----
***************
*** 7266,7270 ****
  
      Py_BEGIN_ALLOW_THREADS
!     rc = DosQuerySysInfo(1, QSV_MAX, &values[1], sizeof(values));
      Py_END_ALLOW_THREADS
  
--- 7260,7264 ----
  
      Py_BEGIN_ALLOW_THREADS
!     rc = DosQuerySysInfo(1L, QSV_MAX, &values[1], sizeof(ULONG) * QSV_MAX);
      Py_END_ALLOW_THREADS