[Bug 21129] New: cmd /? should give a help message, not '/?'
http://bugs.winehq.org/show_bug.cgi?id=21129 Summary: cmd /? should give a help message, not '/?' Product: Wine Version: 1.1.35 Platform: x86 OS/Version: Linux Status: NEW Keywords: download, source Severity: trivial Priority: P2 Component: programs AssignedTo: wine-bugs(a)winehq.org ReportedBy: austinenglish(a)gmail.com On Windows, running: cmd /c echo /? gives: Displays messages, or turns command-echoing on or off. ECHO [ON | OFF] ECHO [message] Type ECHO without parameters to display the current echo setting. On Wine, just gives: /? -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|source | --- Comment #1 from Austin English <austinenglish(a)gmail.com> 2009-12-22 21:51:57 --- Test added: http://code.google.com/p/winezeug/source/detail?r=897 -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 Dan Kegel <dank(a)kegel.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|programs |cmd -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 Jason Edmeades <us(a)edmeades.me.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |us(a)edmeades.me.uk --- Comment #2 from Jason Edmeades <us(a)edmeades.me.uk> 2010-01-06 18:26:41 --- Adding myself to the cmd bugs -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 Arjun Comar <mandaya(a)rose-hulman.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mandaya(a)rose-hulman.edu --- Comment #3 from Arjun Comar <mandaya(a)rose-hulman.edu> 2010-03-02 15:35:55 --- Turns out cmd was completely ignoring /?. I'm attaching a patch that fixes the problem. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 --- Comment #4 from Arjun Comar <mandaya(a)rose-hulman.edu> 2010-03-02 15:39:12 --- Created an attachment (id=26580) --> (http://bugs.winehq.org/attachment.cgi?id=26580) Hotfix Forces a check on the parameter to see if it is /?. If it is, it turns the command into a help with the command as a parameter. Had to change a couple lines in the help lookup function because it wasn't referencing the local command but rather some global param1 variable. That may be incorrect, let me know. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 --- Comment #5 from Austin English <austinenglish(a)gmail.com> 2010-03-02 15:43:38 --- I haven't tested the patch (at work, so no wine), but be careful of cases like: 'cmd /c echo hi /' which should give: C:\Documents and Settings\austin>cmd /c echo hi /? hi /? -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 --- Comment #6 from Arjun Comar <mandaya(a)rose-hulman.edu> 2010-03-02 15:54:24 --- That's no problem, works just fine. "echo /? hi" gives "/? hi". I'm not sure what the expected output for that one is. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 --- Comment #7 from Austin English <austinenglish(a)gmail.com> 2010-03-02 15:56:02 --- (In reply to comment #6)
That's no problem, works just fine.
"echo /? hi" gives "/? hi". I'm not sure what the expected output for that one is.
C:\Documents and Settings\austin>echo /? hi Displays messages, or turns command-echoing on or off. ECHO [ON | OFF] ECHO [message] Type ECHO without parameters to display the current echo setting. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 Arjun Comar <mandaya(a)rose-hulman.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26580|0 |1 is obsolete| | --- Comment #8 from Arjun Comar <mandaya(a)rose-hulman.edu> 2010-03-02 15:59:50 --- Created an attachment (id=26582) --> (http://bugs.winehq.org/attachment.cgi?id=26582) Only checks first param Alright, logged onto Windows to test it. echo /? hi yields the help message. So here's an updated patch. This one only checks the first parameter to see if it is /?. If it is, it displays a help message. Otherwise the command is executed as normal. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 Arjun Comar <mandaya(a)rose-hulman.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26580|1 |0 is obsolete| | --- Comment #9 from Arjun Comar <mandaya(a)rose-hulman.edu> 2010-03-02 16:59:33 --- (From update of attachment 26580)
From a2b4c954166f4fde758daed27559696fe931c239 Mon Sep 17 00:00:00 2001 From: Arjun Comar <mandaya(a)rose-hulman.edu> Date: Tue, 2 Mar 2010 16:26:09 -0500 Subject: Bug21129_cmd_fix
--- programs/cmd/builtins.c | 4 ++-- programs/cmd/wcmdmain.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index fdb4404..15d320c 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -1134,12 +1134,12 @@ void WCMD_give_help (WCHAR *command) { else { for (i=0; i<=WCMD_EXIT; i++) { if (CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, - param1, -1, inbuilt[i], -1) == 2) { + command, -1, inbuilt[i], -1) == 2) { WCMD_output_asis (WCMD_LoadMessage(i)); return; } } - WCMD_output (WCMD_LoadMessage(WCMD_NOCMDHELP), param1); + WCMD_output (WCMD_LoadMessage(WCMD_NOCMDHELP), command); } return; } diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index f97a1fd..41efccc 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1411,6 +1411,15 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects, WCMD_parse (p, quals, param1, param2); WINE_TRACE("param1: %s, param2: %s\n", wine_dbgstr_w(param1), wine_dbgstr_w(param2));
+ if((p[0] == '/') && (p[1] == '?')) { + + /*this is a help request for a program*/ + i = WCMD_HELP; + memcpy(p, whichcmd, count * sizeof(WCHAR)); + p[count] = '\0'; + + } + switch (i) {
case WCMD_ATTRIB: -- 1.7.0
-- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 Arjun Comar <mandaya(a)rose-hulman.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26582|0 |1 is obsolete| | -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #10 from Austin English <austinenglish(a)gmail.com> 2010-03-04 11:26:59 --- Should be fixed by http://source.winehq.org/git/wine.git/?a=commitdiff;h=a607f53779e9cde1d706e9.... Thanks Arjun! -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21129 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #11 from Alexandre Julliard <julliard(a)winehq.org> 2010-03-05 12:43:16 --- Closing bugs fixed in 1.1.40. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org