This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

What is rationale for GLOB_BRACE in globify() from /winsup/cygwin/

NOTE: all text I wrote about invoking Cygwin app from native Windows app.

Look to code:

  /* Attempt to match the argument.  Return just word (minus quoting) if no match. */
  if (glob (pattern, GLOB_TILDE | GLOB_NOCHECK | GLOB_BRACE | GLOB_QUOTE, NULL, &gl) || !gl.gl_pathc)
    return 0;

from /winsup/cygwin/

Brace globing does not defined in POSIX (I check POSIX "2. Shell Command
Language" and glob() page.

It is available in bash by default (set -B). But does not work in ash...

Previously I have issue with striping of '{}' from arguments when used in
native Emacs:

Every Emacs release I patch /emacs/lisp/vc/vc-hg.el because of arguments:

  ... "--template" "{rev}" ...

by quoting {rev} in single quotes. I can not use CYGWIN=noglob because in that
case I get another issue (CYGWIN=noglob remove double quotes from args):

Another people also have trouble with this behavior (Disable Cygwin dll
autoglobbing when git is not run via shell):

for package:

Expanding of {} is not fully consecutive, from globexp1() code:

  /* Protect a single {}, for find(1), like csh */

I ask for making this behavior configurable, like:


Note that CYGWIN=noglob is not proper solution with native Emacs for me as:

 1) It buggy when double quotes was used.
 2) Require rewrite existing code to properly quote arguments as I like set
 shell to bash...

When I say buggy I mean next. If you compile

with MS visual studio and run from cmd:

  cmd> argv a\"b

you get:

  0: argv
  1: a"b

When you compile:

  for (i = 0; i < argc; i++)
    printf("%d: %s\n", argv[i]);

with Cygwin gcc you get:

  cmd> set CYGWIN=noglob
  cmd> cygargv a\"b
  0: cygargv
  1: a\b

When I commit from cmd (usually this is FAR file manager) with CYGWIN=noglob
all quotes striped from my commit messages... ((

I would like to hear any comments...

Best regards!

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]