Re: shell32: fix program search in ShellExecuteEx, quote program name if it contains spaces (resend)
Hi Stefan, I know this is nitpicking, but: - memcpy(buffer, sei_tmp.lpFile, idx * sizeof(WCHAR)); + lstrcpynW(buffer, wszApplicationName, sizeof(buffer)/sizeof(WCHAR)); + while((space=strchrW(buffer, ' '))) You're mixing tabs and spaces here. --Juan
Hi again Stefan, I just took a little closer look, and you have more whitespace issues in the patch: - LPCWSTR p = space + 1; + LPCWSTR p = wszApplicationName + idx + 1; Why two spaces after the =? + strcatW(wcmd, wQuote); + } else strcpyW(wcmd, wszApplicationName); + You should indent the strcpyW, even though it makes the patch a bit longer. Finally, this isn't about whitespace but style: + if((needs_quote = NULL != strstrW(wszApplicationName,wSpace))) + len +=2; The expression in the if is unnecessary complicated. You could use consistent spacing here too. --Juan
Am Friday 14 August 2009 18:05:23 schrieb Juan Lang:
Finally, this isn't about whitespace but style: + if((needs_quote = NULL != strstrW(wszApplicationName,wSpace))) + len +=2;
The expression in the if is unnecessary complicated. You could use consistent spacing here too.
Hi Juan, i don't understand what you mean here with "complicated", please explain it. Thanks Stefan
Hi Stefan,
+ if((needs_quote = NULL != strstrW(wszApplicationName,wSpace))) + len +=2;
i don't understand what you mean here with "complicated", please explain it.
Questions of style are always in the eye of the beholder, aren't they? ;-) I'd say breaking the statement into two would be easier to understand: needs_quote = strstrW(wszApplicationName, wSpace) != NULL; if (needs_quote) len += 2; Thanks, --Juan
participants (2)
-
Juan Lang -
Stefan Leichter