Module: wine
Branch: master
Commit: c4885bc46f105dbe372beda92503a78ce0cbbb1f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c4885bc46f105dbe372beda92…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com>
Date: Sun Jun 3 22:07:44 2007 +0100
cmd.exe: Fix handling of malformed environment variable expansion.
---
programs/cmd/wcmdmain.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index ae27415..a5cd510 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1535,9 +1535,15 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start) {
/* Find the end of the environment variable, and extract name */
endOfVar = strchrW(start+1, '%');
if (endOfVar == NULL) {
- /* FIXME: Some special conditions here depending on whether
+ /* In batch program, missing terminator for % and no following
+ ':' just removes the '%' */
+ s = WCMD_strdupW(start + 1);
+ strcpyW (start, s);
+ free(s);
+
+ /* FIXME: Some other special conditions here depending on whether
in batch, complex or not, and whether env var exists or not! */
- return start+1;
+ return start;
}
memcpy(thisVar, start, ((endOfVar - start) + 1) * sizeof(WCHAR));
thisVar[(endOfVar - start)+1] = 0x00;
Module: wine
Branch: master
Commit: a1b55be6935a6a3b44fff69eed6dfdee53d217f7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a1b55be6935a6a3b44fff69ee…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl>
Date: Mon Jun 4 00:26:46 2007 +0200
comctl32: listview: Make LVM_GETCOLUMNWIDTH query the header control instead of using cached data.
---
dlls/comctl32/listview.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 38f9c18..ba94aec 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -5147,7 +5147,7 @@ static BOOL LISTVIEW_GetColumnOrderArray(const LISTVIEW_INFO *infoPtr, INT iCoun
static INT LISTVIEW_GetColumnWidth(const LISTVIEW_INFO *infoPtr, INT nColumn)
{
INT nColumnWidth = 0;
- RECT rcHeader;
+ HDITEMW hdItem;
TRACE("nColumn=%d\n", nColumn);
@@ -5158,9 +5158,19 @@ static INT LISTVIEW_GetColumnWidth(const LISTVIEW_INFO *infoPtr, INT nColumn)
nColumnWidth = infoPtr->nItemWidth;
break;
case LVS_REPORT:
- if (nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return 0;
- LISTVIEW_GetHeaderRect(infoPtr, nColumn, &rcHeader);
- nColumnWidth = rcHeader.right - rcHeader.left;
+ /* We are not using LISTVIEW_GetHeaderRect as this data is updated only after a HDM_ITEMCHANGED.
+ * There is an application that subclasses the listview, calls LVM_GETCOLUMNWIDTH in the
+ * HDM_ITEMCHANGED handler and goes into infinite recursion if it receives old data.
+ *
+ * TODO: should we do the same in LVM_GETCOLUMN?
+ */
+ hdItem.mask = HDI_WIDTH;
+ if (!SendMessageW(infoPtr->hwndHeader, HDM_GETITEMW, nColumn, (LPARAM)&hdItem))
+ {
+ WARN("(%p): HDM_GETITEMW failed for item %d\n", infoPtr->hwndSelf, nColumn);
+ return 0;
+ }
+ nColumnWidth = hdItem.cxy;
break;
}