Hi All, 

In a (admittedly not current) version of 64 bit Cygwin, I'm observing a funny
behavior:

The GetCommandLineW function returns a command line which consists of the
executable name only; the arguments are missing.

This issue goes away when the program is run under GDB; the arguments
prepared by GDB do then appear in the command line.

The issue is not seen under 32 bits.

The repro program uses WinMain; I've not compared whether using
main makes a difference:

#include <windows.h>
#include <stdio.h>
#include <wchar.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine, int nShowCmd)
{
  int argc, i;
  LPWSTR cmdline = GetCommandLineW();
  wprintf(L"cmdline = %ls\n", cmdline);
  return 0;
}

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to