Module: wine
Branch: master
Commit: d929cdef979a344926bc9f5c04eaf944a14e1b61
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d929cdef979a344926bc9f5c0…
Author: Rob Shearman <robertshearman(a)gmail.com>
Date: Fri Oct 3 12:57:50 2008 +0100
wininet: Return error codes explicitly from URLCache functions instead of returning a BOOL and storing the error code in the last error value.
This makes the code more efficient and allows errors from functions to
be ignored without side-effects.
---
dlls/wininet/urlcache.c | 350 +++++++++++++++++++++++++++++++++--------------
1 files changed, 246 insertions(+), 104 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=d929cdef979a344926bc9…
Module: wine
Branch: master
Commit: 930f8f5af615dc427f6acbdadc082a741aebdd72
URL: http://source.winehq.org/git/wine.git/?a=commit;h=930f8f5af615dc427f6acbdad…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com>
Date: Fri Oct 3 00:49:39 2008 -0400
richedit: Removed invalid assertion.
The assertion was not valid, because it neglected to take into account
the situation where a line break is forced with a MERF_ENDROW run
(caused by \line control word or pressing Shift-Enter). This means
that spaces can cause a line wrap after a forced line break as well as
after a paragraph break, so we cannot assert that it is the first row
in the paragraph.
---
dlls/riched20/wrap.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c
index 6f6e32c..d6a2492 100644
--- a/dlls/riched20/wrap.c
+++ b/dlls/riched20/wrap.c
@@ -416,9 +416,11 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p)
{
if (run->nFlags & MERF_STARTWHITE)
{
- /* we had only spaces so far, so we must be on the first line of the
- * paragraph, since no other lines of the paragraph start with spaces. */
- assert(!wc->nRow);
+ /* We had only spaces so far, so we must be on the first line of the
+ * paragraph (or the first line after MERF_ENDROW forced the line
+ * break within the paragraph), since no other lines of the paragraph
+ * start with spaces. */
+
/* The lines will only contain spaces, and the rest of the run will
* overflow onto the next line. */
wc->bOverflown = TRUE;
Module: wine
Branch: master
Commit: af47ac09d5c3ec6560e93770669fa5ff4b2627ad
URL: http://source.winehq.org/git/wine.git/?a=commit;h=af47ac09d5c3ec6560e937706…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com>
Date: Thu Oct 2 17:33:33 2008 -0400
richedit: Avoided testing for undocumented behaviour causing test to fail.
The test for EM_GETLINE was testing to make sure the null terminating
character was written at the end of the text as long as the buffer was
long enough, and also tested to make sure that no other bytes were
written after this null terminating character. This is consistent with
Windows 2000 and up, but not for previous versions of Windows.
---
dlls/riched20/tests/editor.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index 1c03eca..87e67da 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -306,7 +306,7 @@ static void test_EM_GETLINE(void)
{
int nCopied;
int expected_nCopied = min(gl[i].buffer_len, strlen(gl[i].text));
- int expected_bytes_written = min(gl[i].buffer_len, strlen(gl[i].text) + 1);
+ int expected_bytes_written = min(gl[i].buffer_len, strlen(gl[i].text));
memset(dest, 0xBB, nBuf);
*(WORD *) dest = gl[i].buffer_len;
@@ -332,16 +332,27 @@ static void test_EM_GETLINE(void)
for (j = 0; j < 32; j++)
sprintf(resultbuf+strlen(resultbuf), "%02x", dest[j] & 0xFF);
expectedbuf[0] = '\0';
- for (j = 0; j < expected_bytes_written; j++)
+ for (j = 0; j < expected_bytes_written; j++) /* Written bytes */
sprintf(expectedbuf+strlen(expectedbuf), "%02x", gl[i].text[j] & 0xFF);
- for (; j < 32; j++)
+ for (; j < gl[i].buffer_len; j++) /* Ignored bytes */
+ sprintf(expectedbuf+strlen(expectedbuf), "??");
+ for (; j < 32; j++) /* Bytes after declared buffer size */
sprintf(expectedbuf+strlen(expectedbuf), "%02x", origdest[j] & 0xFF);
+ /* Test the part of the buffer that is expected to be written according
+ * to the MSDN documentation fo EM_GETLINE, which does not state that
+ * a NULL terminating character will be added unless no text is copied.
+ *
+ * Windows 95, 98 & NT do not append a NULL terminating character, but
+ * Windows 2000 and up do append a NULL terminating character if there
+ * is space in the buffer. The test will ignore this difference. */
ok(!strncmp(dest, gl[i].text, expected_bytes_written),
"%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n",
i, expected_bytes_written, expectedbuf, resultbuf);
- ok(!strncmp(dest + expected_bytes_written, origdest
- + expected_bytes_written, nBuf - expected_bytes_written),
+ /* Test the part of the buffer after the declared length to make sure
+ * there are no buffer overruns. */
+ ok(!strncmp(dest + gl[i].buffer_len, origdest + gl[i].buffer_len,
+ nBuf - gl[i].buffer_len),
"%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n",
i, expected_bytes_written, expectedbuf, resultbuf);
}