Incorrect expansion of a program argument that is a special character?

Ev Drikos drikosev@gmail.com
Wed Jul 21 11:42:59 GMT 2021


Hello,

When I run the program below from my home directory in a PowerShell
Console (Windows 8-1) I've to use an extra backslash character as
shown below or the star is expanded. Which happens only when the
program has been compiled in Cygwin.

Is this a bug or a known feature?

Ev. Drikos

----------------------------------------------
PS C:\Users\suser> .\args.exe '\*'

*
argc=1
PS C:\Users\suser>
----------------------------------------------

#include <stdio.h>
int main(int argc, char *argv[]){
int i;
for (i=1; i < argc; i++) {
  printf("\n%s",argv[i]);
}//for
 printf("\nargc=%d\n",argc-1);
return 0;
}


More information about the Cygwin mailing list