delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/04/15:00:56

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <01c101c2fae4$daae51e0$5300a8c0@pomello>
From: "Max Bowsher" <maxb AT ukf DOT net>
To: "BB" <canofspam AT att DOT net>, <cygwin AT cygwin DOT com>
References: <b6kfnf$nb9$1 AT main DOT gmane DOT org>
Subject: Re: Bug in GUI App WinMain Arguements
Date: Fri, 4 Apr 2003 19:58:27 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

BB wrote:
> I'm having a problem running a windows gui app with arguments from a
> mounted directory if the Win32Path mounted to contains blanks. (i.e.
> mount -s -b "C:/foo bar" "/foobar"). It's not a mount specific problem
> because it also occurs if the directory has a space in it.  Since
> mkpasswd defaulted my home directory to "/cygdrive/c/Documents and
> Settings/cygusr", I am assuming Cygwin supports directories with spaces
> in them.

Cygwin is a collection of many programs and scripts. Some of them don't
support spaces in directory names. Therefore, it is advisable to avoid using
spaces.

The default home dir is not in "Documents and Settings". Cygwin is noticing
that you have HOME set in your environment, and using that. You probably
don't want that. Why is HOME set?

>  I have included a small program that illustrates the bug.
>
> By the way, I'm running on XP with the latest version of Cygwin newly
> installed.
>
> Also, according to the "Cygwin Users Guide", I have included the following
> line in the code.
> WinMainCRTStartup() { mainCRTStartup(); }
> It doesnt seem to be called.  Is the User Guide correct? The same problem
> occurs if I omit the line and use the "-e _mainCRTStartup" as suggested in
> the User Guide.

This sounds like out-of-date info to me (but that's just a guess).

> Any suggestions?

There seems to be a bug in Cygwin.
The following are unrelated to the bug:
- HOME directory
- "| tail -"
- WinMainCRTStartup
- gstr
- -mwindows

I have snipped your testcase appropriately.

You can easily show that the bug is in Cygwin, as it does not occur when the
testcase is compiled with -mno-cygwin.

> $ pwd
> /cygdrive/c/Documents and Settings/cygusr
> $ ./prtcmdline arg1 arg2
> and Settings\cygusr\prtcmdline.exe" arg1 arg2      << wrong
> $ cp prtcmdline.exe /home/cygusr
> $ /home/cygusr/prtcmdline arg1 arg2
> arg1 arg2                       <<right
> $
>
> /****************************************************/
> /* prtcmdline.c                                     */
> /* gcc prtcmdline.c -o prtcmdline.exe               */
> /****************************************************/
> #include <windows.h>
> #include <stdio.h>
>
> int APIENTRY WinMain(HINSTANCE hInstance,
>                      HINSTANCE hPrevInstance,
>                      LPSTR     lpCmdLine,
>                      int       nCmdShow)
> {
>  puts(lpCmdLine);
>  return 0;
> }
> /****************************************************/

Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019