From: Gurusamy Sarathy Date: Mon, 19 Jul 1999 00:33:59 +0000 (+0000) Subject: avoid bug in win32_str_os_error() (from Jan Dubois) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2ce77adffcc4a54956eaa524ddf0afc1210b30b2;p=p5sagit%2Fp5-mst-13.2.git avoid bug in win32_str_os_error() (from Jan Dubois) p4raw-id: //depot/perl@3699 --- diff --git a/Changes b/Changes index ed52997..732a864 100644 --- a/Changes +++ b/Changes @@ -79,6 +79,53 @@ Version 5.005_58 Development release working toward 5.006 ---------------- ____________________________________________________________________________ +[ 3697] By: gsar on 1999/07/18 05:22:36 + Log: From: pvhp@forte.com (Peter Prymmer) + Date: Thu, 1 Jul 99 19:31:24 PDT + Message-Id: <9907020231.AA16942@forte.com> + Subject: [ID 19990701.031] 4 ctl chars on EBCDIC not asciiish enough + Branch: perl + + t/op/chars.t + ! MANIFEST ebcdic.c t/op/ord.t +____________________________________________________________________________ +[ 3696] By: gsar on 1999/07/18 05:11:02 + Log: display thread id in diagnostics (suggested by Dan Sugalski) + Branch: perl + ! lib/Carp.pm util.c +____________________________________________________________________________ +[ 3695] By: gsar on 1999/07/18 04:57:47 + Log: missing perldiag entry (from Dan Sugalski ) + Branch: perl + ! pod/perldiag.pod +____________________________________________________________________________ +[ 3694] By: gsar on 1999/07/18 04:56:28 + Log: cache [NIUP]V conversions of defined READONLY values + From: Ilya Zakharevich + Date: Sun, 11 Jul 1999 04:39:44 -0400 + Message-ID: <19990711043944.A25944@monk.mps.ohio-state.edu> + Subject: [PATCH 5.005_57] Allow caching of numeric/string conversion + Branch: perl + ! sv.c +____________________________________________________________________________ +[ 3693] By: gsar on 1999/07/18 03:53:38 + Log: From: jan.dubois@ibm.net (Jan Dubois) + Date: Sat, 17 Jul 1999 10:58:29 +0200 + Message-ID: <379144ad.13616689@smtp1.ibm.net> + Subject: [PATCH 5.005] Some lib/ExtUtils/Manifest.pm POD fixes + Branch: perl + ! lib/ExtUtils/Manifest.pm +____________________________________________________________________________ +[ 3692] By: gsar on 1999/07/18 03:51:03 + Log: remove spurious newSTATEOP() that causes goto to enter one too many + contexts when jumping between if and elsif blocks + Branch: perl + ! perly.c perly.y pp_ctl.c t/op/goto.t +____________________________________________________________________________ +[ 3691] By: gsar on 1999/07/18 01:49:59 + Log: detypo, update Changes + Branch: perl + ! Changes doio.c +____________________________________________________________________________ [ 3690] By: gsar on 1999/07/18 01:16:59 Log: mention the -Minteger effect on modulus (from Nathan Torkington) Branch: perl diff --git a/win32/win32.c b/win32/win32.c index 59e493a..b28b042 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1802,12 +1802,14 @@ win32_str_os_error(void *sv, DWORD dwErr) |FORMAT_MESSAGE_IGNORE_INSERTS |FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, 0, (char *)&sMsg, 1, NULL); + /* strip trailing whitespace and period */ if (0 < dwLen) { - while (0 < dwLen && isSPACE(sMsg[--dwLen])) - ; + do { + --dwLen; /* dwLen doesn't include trailing null */ + } while (0 < dwLen && isSPACE(sMsg[dwLen])); if ('.' != sMsg[dwLen]) dwLen++; - sMsg[dwLen]= '\0'; + sMsg[dwLen] = '\0'; } if (0 == dwLen) { sMsg = (char*)LocalAlloc(0, 64/**sizeof(TCHAR)*/);