Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

strange argv quoting behaviour

I just noticed the following oddity. Trivial test program foo.c:

#include <stdio.h>

int main(int argc, char **argv)
        printf("%d: (%s) (%s)\n", argc, argv[1], argv[2]);

        return 0;

% ./foo *
3: (foo) (foo.c)
% ./foo abc
2: (abc) ((null))
% ./foo 'abc'
2: (abc) ((null))
% ./foo abc *
4: (abc) (foo)
% ./foo 'abc' *
4: (\a\b\c) (foo)

That last case suggests some aggressive overquoting - but it only happens
if there is a '*' as an argument afterwards!
(Checked on a yesterday current box, csh)



Home | Main Index | Thread Index | Old Index