summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--Makefile10
-rw-r--r--m4/alloca.m426
-rw-r--r--m4/pselect.m418
-rw-r--r--m4/strtod.m42
-rw-r--r--tests/test-argp.c10
-rwxr-xr-xtests/test-c-stack2.sh18
-rwxr-xr-xtests/test-parse-duration.sh16
-rw-r--r--tests/test-userspec.c10
9 files changed, 72 insertions, 50 deletions
diff --git a/ChangeLog b/ChangeLog
index 4939b801d5..88eca7952d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-07-04 Jim Meyering <meyering@redhat.com>
+
+ maint: indent with spaces, not TABs, and add a rule to check this
+ * tests/test-userspec.c: Indent with spaces, not TABs.
+ * tests/test-argp.c: Likewise.
+ * tests/test-c-stack2.sh: Likewise.
+ * tests/test-parse-duration.sh: Likewise
+ * m4/strtod.m4: Likewise.
+ * m4/alloca.m4: Likewise.
+ * m4/pselect.m4: Likewise.
+ * Makefile (sc_prohibit_leading_TABs): Prohibit leading TABs.
+
2011-07-03 Jim Meyering <meyering@redhat.com>
maint.mk: correct omissions in prohibit_argmatch_without_use check
diff --git a/Makefile b/Makefile
index 0da864c6ac..fcc73f6a38 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,16 @@ sc_prefer_ac_check_funcs_once:
in modules/ 1>&2; exit 1; } || : \
else :; fi
+sc_prohibit_leading_TABs:
+ if test -d .git; then \
+ url=FIXME; \
+ git grep -l '^ * ' lib m4 tests \
+ | grep -Ev '^m4/po\.m4|^lib/reg|Makefile|test-update-copyright' \
+ | grep . \
+ && { printf '*** %s\n' 'indent with spaces, not TABs;' \
+ 1>&2; exit 1; } || : \
+ else :; fi
+
sc_prohibit_augmenting_PATH_via_TESTS_ENVIRONMENT:
if test -d .git; then \
url=http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/22874; \
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index 891fc8bc36..a8744a844f 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,4 +1,4 @@
-# alloca.m4 serial 12
+# alloca.m4 serial 13
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -76,17 +76,17 @@ wenotbecray
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
AC_CHECK_FUNC($ac_func,
- [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
- [Define to one of `_getb67', `GETB67',
- `getb67' for Cray-2 and Cray-YMP
- systems. This function is required for
- `alloca.c' support on those systems.])
+ [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
+ [Define to one of `_getb67', `GETB67',
+ `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for
+ `alloca.c' support on those systems.])
break])
done
fi
AC_CACHE_CHECK([stack direction for C alloca],
- [ac_cv_c_stack_direction],
+ [ac_cv_c_stack_direction],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[AC_INCLUDES_DEFAULT
int
@@ -105,16 +105,16 @@ main (int argc, char **argv)
{
return find_stack_direction (0, argc + !argv + 20) < 0;
}])],
- [ac_cv_c_stack_direction=1],
- [ac_cv_c_stack_direction=-1],
- [ac_cv_c_stack_direction=0])])
+ [ac_cv_c_stack_direction=1],
+ [ac_cv_c_stack_direction=-1],
+ [ac_cv_c_stack_direction=0])])
AH_VERBATIM([STACK_DIRECTION],
[/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
@%:@undef STACK_DIRECTION])dnl
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
])# _AC_LIBOBJ_ALLOCA
diff --git a/m4/pselect.m4 b/m4/pselect.m4
index 5a76a7b8d9..da043d1f43 100644
--- a/m4/pselect.m4
+++ b/m4/pselect.m4
@@ -14,15 +14,15 @@ AC_DEFUN([gl_FUNC_PSELECT],
AC_CACHE_CHECK([whether signature of pselect conforms to POSIX],
gl_cv_sig_pselect,
[AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/select.h>
- ]],
- [[int (*p) (int, fd_set *, fd_set *, fd_set *restrict,
- struct timespec const *restrict,
- sigset_t const *restrict) = pselect;
- return !p;]])],
- [gl_cv_sig_pselect=yes],
- [gl_cv_sig_pselect=no])])
+ [AC_LANG_PROGRAM(
+ [[#include <sys/select.h>
+ ]],
+ [[int (*p) (int, fd_set *, fd_set *, fd_set *restrict,
+ struct timespec const *restrict,
+ sigset_t const *restrict) = pselect;
+ return !p;]])],
+ [gl_cv_sig_pselect=yes],
+ [gl_cv_sig_pselect=no])])
fi
if test $ac_cv_func_pselect = no || test $gl_cv_sig_pselect = no; then
diff --git a/m4/strtod.m4 b/m4/strtod.m4
index bd97667b26..e83e89882c 100644
--- a/m4/strtod.m4
+++ b/m4/strtod.m4
@@ -101,7 +101,7 @@ numeric_equal (double x, double y)
[gl_cv_func_strtod_works=yes],
[gl_cv_func_strtod_works=no],
[dnl The last known bugs in glibc strtod(), as of this writing,
- dnl were fixed in version 2.8
+ dnl were fixed in version 2.8
AC_EGREP_CPP([Lucky user],
[
#include <features.h>
diff --git a/tests/test-argp.c b/tests/test-argp.c
index f0b864d81d..8fab727c9a 100644
--- a/tests/test-argp.c
+++ b/tests/test-argp.c
@@ -226,7 +226,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
{
case ARGP_KEY_INIT:
for (i = 0; state->root_argp->children[i].argp; i++)
- state->child_inputs[i] = args;
+ state->child_inputs[i] = args;
break;
case 't':
@@ -346,7 +346,7 @@ test6 (struct argp *argp)
void
test_optional (struct argp *argp, int argc, char **argv,
- struct test_args *args, const char *val, const char *a)
+ struct test_args *args, const char *val, const char *a)
{
int index;
if (argp_parse (argp, argc, argv, 0, &index, args))
@@ -357,7 +357,7 @@ test_optional (struct argp *argp, int argc, char **argv,
if (!val)
{
if (args->optional)
- fail ("option processed incorrectly");
+ fail ("option processed incorrectly");
}
else if (strcmp (args->optional, val))
fail ("option processed incorrectly");
@@ -365,9 +365,9 @@ test_optional (struct argp *argp, int argc, char **argv,
if (a)
{
if (index == argc)
- fail ("expected command line argument not found");
+ fail ("expected command line argument not found");
else if (strcmp (argv[index], a))
- fail ("expected command line argument does not match");
+ fail ("expected command line argument does not match");
}
}
diff --git a/tests/test-c-stack2.sh b/tests/test-c-stack2.sh
index a80373dc49..0cd49c969b 100755
--- a/tests/test-c-stack2.sh
+++ b/tests/test-c-stack2.sh
@@ -11,16 +11,16 @@ tmpfiles="t-c-stack2.tmp"
case $? in
77) if grep 'stack overflow' t-c-stack2.tmp >/dev/null ; then
- if test -z "$LIBSIGSEGV"; then
- echo 'cannot tell stack overflow from crash; consider installing libsigsegv' >&2
- exit 77
- else
- echo 'cannot tell stack overflow from crash, in spite of libsigsegv' >&2
- exit 1
- fi
+ if test -z "$LIBSIGSEGV"; then
+ echo 'cannot tell stack overflow from crash; consider installing libsigsegv' >&2
+ exit 77
+ else
+ echo 'cannot tell stack overflow from crash, in spite of libsigsegv' >&2
+ exit 1
+ fi
else
- cat t-c-stack2.tmp >&2
- exit 77
+ cat t-c-stack2.tmp >&2
+ exit 77
fi
;;
0) (exit 1); exit 1 ;;
diff --git a/tests/test-parse-duration.sh b/tests/test-parse-duration.sh
index 6aeb2253e6..5398c3bf7f 100755
--- a/tests/test-parse-duration.sh
+++ b/tests/test-parse-duration.sh
@@ -50,14 +50,14 @@ trap 'rm -rf "${tmp}"' EXIT
tmpf="${tmp}/tests.txt"
cat > "${tmpf}" <<- _EOF_
- 1 Y 2 M 3 W 4 d 5 h 6 m 7 s
- P 00010225 T 05:06:07
- P 1Y2M3W4D T 5H6M7S
- 1 Y 2 M 25 D 5:6:7
- 1 Y 2 M 25 d 5h 6:7
- 1 Y 2 M 25 d 5h 6m 7
- P 1-2-25 T 5:6:7
- _EOF_
+ 1 Y 2 M 3 W 4 d 5 h 6 m 7 s
+ P 00010225 T 05:06:07
+ P 1Y2M3W4D T 5H6M7S
+ 1 Y 2 M 25 D 5:6:7
+ 1 Y 2 M 25 d 5h 6:7
+ 1 Y 2 M 25 d 5h 6m 7
+ P 1-2-25 T 5:6:7
+ _EOF_
exec 3< "${tmpf}"
while read line <&3
diff --git a/tests/test-userspec.c b/tests/test-userspec.c
index 65f60da5c3..dcb1b3ef38 100644
--- a/tests/test-userspec.c
+++ b/tests/test-userspec.c
@@ -144,7 +144,7 @@ main (void)
char *user_name;
char *group_name;
char const *diag = parse_user_spec (T[i].in, &uid, &gid,
- &user_name, &group_name);
+ &user_name, &group_name);
free (user_name);
free (group_name);
if (!same_diag (diag, T[i].result))
@@ -161,8 +161,8 @@ main (void)
if (uid != T[i].uid || gid != T[i].gid)
{
printf ("%s mismatch (-: expected uid,gid; +:actual)\n"
- "-%3lu,%3lu\n+%3lu,%3lu\n",
- T[i].in,
+ "-%3lu,%3lu\n+%3lu,%3lu\n",
+ T[i].in,
(unsigned long int) T[i].uid,
(unsigned long int) T[i].gid,
(unsigned long int) uid,
@@ -175,8 +175,8 @@ main (void)
{
printf ("%s diagnostic mismatch (-: expected uid,gid; +:actual)\n"
- "-%s\n+%s\n",
- T[i].in, T[i].result, diag);
+ "-%s\n+%s\n",
+ T[i].in, T[i].result, diag);
fail = 1;
}
}