aboutsummaryrefslogtreecommitdiff
path: root/posix/globtest.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-03-20 00:46:01 +0000
committerUlrich Drepper <drepper@redhat.com>2000-03-20 00:46:01 +0000
commit460adbb8475bffc72e749fe841e737e18154b8f5 (patch)
tree540e228ac1a0ae5edc8bc0bfa4d65a034b357562 /posix/globtest.c
parent4cec02b2ba18a18203c2a0008de8d35f46f92de8 (diff)
downloadglibc-460adbb8475bffc72e749fe841e737e18154b8f5.tar
glibc-460adbb8475bffc72e749fe841e737e18154b8f5.tar.gz
glibc-460adbb8475bffc72e749fe841e737e18154b8f5.tar.bz2
glibc-460adbb8475bffc72e749fe841e737e18154b8f5.zip
Update comment about _SLOWDOWN flags.
Diffstat (limited to 'posix/globtest.c')
-rw-r--r--posix/globtest.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/posix/globtest.c b/posix/globtest.c
index 970d90a31c..90b9eb6ad3 100644
--- a/posix/globtest.c
+++ b/posix/globtest.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,9 @@ main (int argc, char *argv[])
glob_t g;
int quotes = 1;
- while ((i = getopt (argc, argv, "bcdegmopqstT")) != -1)
+ g.gl_offs = 0;
+
+ while ((i = getopt (argc, argv, "bcdeEgmopqstT")) != -1)
switch(i)
{
case 'b':
@@ -44,6 +46,9 @@ main (int argc, char *argv[])
case 'e':
glob_flags |= GLOB_NOESCAPE;
break;
+ case 'E':
+ glob_flags |= GLOB_ERR;
+ break;
case 'g':
glob_flags |= GLOB_NOMAGIC;
break;
@@ -96,15 +101,17 @@ main (int argc, char *argv[])
else if (i == GLOB_NOMATCH)
puts ("GLOB_NOMATCH");
- /* If we set an offset, fill in the first field. */
- if (glob_flags & GLOB_DOOFFS)
+ /* If we set an offset, fill in the first field.
+ (Unless glob() has filled it in already - which is an error) */
+ if ((glob_flags & GLOB_DOOFFS) && g.gl_pathv[0] == NULL)
g.gl_pathv[0] = (char *) "abc";
/* Print out the names. Unless otherwise specified, qoute them. */
if (g.gl_pathv)
{
- for (i = 0; i < g.gl_pathc; ++i)
- printf ("%s%s%s\n", quotes ? "`" : "", g.gl_pathv[i],
+ for (i = 0; i < g.gl_offs + g.gl_pathc; ++i)
+ printf ("%s%s%s\n", quotes ? "`" : "",
+ g.gl_pathv[i] ? g.gl_pathv[i] : "(null)",
quotes ? "'" : "");
}
return 0;