From f0e1c34310483f82473c56f4ea8f151d441a0a41 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 10 Dec 2002 21:44:08 +0000 Subject: [PATCH] Applied patch [ 651383 ] Removes 3 warnings when building w/ CW6 Dimitri Schoolwerth git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filefn.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 1056a66fad..4971630f26 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -428,7 +428,11 @@ wxChar *wxRealPath (wxChar *path) if (p[1] == wxT('.') && p[2] == wxT('.') && (p[3] == SEP || p[3] == wxT('\0'))) { wxChar *q; - for (q = p - 1; q >= path && *q != SEP; q--); + for (q = p - 1; q >= path && *q != SEP; q--) + { + // Empty + } + if (q[0] == SEP && (q[1] != wxT('.') || q[2] != wxT('.') || q[3] != SEP) && (q - 1 <= path || q[-1] != SEP)) { @@ -592,7 +596,11 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) *--d = 0; value = wxGetenv(braces ? start + 1 : start); if (value) { - for ((d = start - 1); (*d++ = *value++) != 0;); + for ((d = start - 1); (*d++ = *value++) != 0;) + { + // Empty + } + d--; if (braces && *s) s++; @@ -616,7 +624,10 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) { /* ~user/filename */ register wxChar *nnm; register wxChar *home; - for (s = nm; *s && *s != SEP; s++); + for (s = nm; *s && *s != SEP; s++) + { + // Empty + } int was_sep; /* MATTHEW: Was there a separator, or NULL? */ was_sep = (*s == SEP); nnm = *s ? s + 1 : s; @@ -643,7 +654,10 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) *(d - 1) = SEP; } s = nm; - while ((*d++ = *s++) != 0); + while ((*d++ = *s++) != 0) + { + // Empty + } delete[] nm_tmp; // clean up alloc /* Now clean up the buffer */ return wxRealPath(buf);