summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-08-20 15:18:35 +0200
committerMichael Meeks <michael.meeks@suse.com>2012-08-20 19:35:19 +0100
commit9127c6d7534d77f0ee5cf34264b682a7e97a92df (patch)
tree9d166b890ad68a1262e6beb79a9bcdac8d2b021a
parentUpdate ./g --set-push-user to work with gerrit. (diff)
downloadcore-9127c6d7534d77f0ee5cf34264b682a7e97a92df.tar.gz
core-9127c6d7534d77f0ee5cf34264b682a7e97a92df.zip
fdo#53252: _toupper is unreliable
<http://msdn.microsoft.com/en-us/library/45119yx3%28v=vs.80%29.aspx> "toupper, _toupper, towupper, _toupper_l, _towupper_l: Visual Studio 2005" states: "In order for toupper to give the expected results, __isascii and isupper must both return nonzero." But a community comment clarifies: "This is incorrect, and should refer to '_toupper' (the macro form), not 'toupper'." (Which makes sense, as otherwise toupper would violate the C Standard.) And indeed, at least for some LO built against MSVC 2008 Express on Windows 7, _toupper('C') = '#' is broken, while toupper('C') = 'C' is good. (And the unexpected '#' then causes all sorts of errors in the code.) Change-Id: Iddaddcaf0cc3ffb30e55b0f410a6cfe9118accc8 Signed-off-by: Petr Mladek <pmladek@suse.cz> Signed-off-by: Tor Lillqvist <tml@iki.fi> Signed-off-by: Michael Meeks <michael.meeks@suse.com>
-rw-r--r--sal/osl/w32/file_dirvol.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx
index d7a531c6782d..47309a4e7374 100644
--- a/sal/osl/w32/file_dirvol.cxx
+++ b/sal/osl/w32/file_dirvol.cxx
@@ -1116,7 +1116,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString *strFilePath, oslDirector
osl_acquireDirectoryItem( (oslDirectoryItem)pItemImpl );
_tcscpy( pItemImpl->cDriveString, reinterpret_cast<LPCTSTR>(strSysFilePath->buffer) );
- pItemImpl->cDriveString[0] = _toupper( pItemImpl->cDriveString[0] );
+ pItemImpl->cDriveString[0] = toupper( pItemImpl->cDriveString[0] );
if ( pItemImpl->cDriveString[_tcslen(pItemImpl->cDriveString) - 1] != '\\' )
_tcscat( pItemImpl->cDriveString, TEXT( "\\" ) );