logo       

Re: cvs: TSRM / tsrm_virtual_cwd.c: msg#00073

Subject: Re: cvs: TSRM / tsrm_virtual_cwd.c
edink Thu Dec 22 21:32:56 2005 EDT

 Modified files:
   /TSRM tsrm_virtual_cwd.c
 Log:
 Back out a portion of the previous patch which broke win32 file functions

http://cvs.php.net/viewcvs.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.75&r2=1.76&diff_format=u
Index: TSRM/tsrm_virtual_cwd.c
diff -u TSRM/tsrm_virtual_cwd.c:1.75 TSRM/tsrm_virtual_cwd.c:1.76
--- TSRM/tsrm_virtual_cwd.c:1.75 Tue Dec 20 14:26:55 2005
+++ TSRM/tsrm_virtual_cwd.c Thu Dec 22 21:32:56 2005
@@ -480,7 +480,7 @@
 {
 int new_path_length;

- new_path_length = GetLongPathName(path, NULL, 0);
+ new_path_length = GetLongPathName(path, NULL, 0) + 1;
 if (new_path_length == 0) {
 return 1;
 }


From http://msdn.microsoft.com/library/en-us/fileio/fs/getlongpathname.asp:
"DWORD GetLongPathName(LPCTSTR lpszShortPath, LPTSTR lpszLongPath, DWORD cchBuffer);

If the lpszLongPath buffer is too small to contain the path, the return value is the size of the buffer that is required to hold the path, including the terminating null character, in TCHARs. Therefore, if the return value is greater than cchBuffer, call the function again using a buffer size that is at least the same size as the return value. If the function fails for any other reason, the return value is 0 (zero). To get extended error information, call GetLastError."

So what was wrong in the previous patch? Now its wrong, because the new_path_length will *never* be 0, so it will never enter in that 'if'. And as it already include the \0, I can't see why that '+1' is required.


Nuno
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe