X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=m4%2Ffpurge.m4;fp=m4%2Ffpurge.m4;h=99d1fc4d0bbca7663d1138c414a6f14e8d7880f9;hb=a8a88eddaa90432e6ec1b8d9d5c9842bc91afd1d;hp=0dd19f3b974edc4befbdc9773965ada61852e88f;hpb=20fcfc81ece044b8b0a6768ec6cf47be4e22a2e6;p=debian%2Fgzip diff --git a/m4/fpurge.m4 b/m4/fpurge.m4 index 0dd19f3..99d1fc4 100644 --- a/m4/fpurge.m4 +++ b/m4/fpurge.m4 @@ -1,5 +1,5 @@ -# fpurge.m4 serial 7 -dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc. +# fpurge.m4 serial 8 +dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,23 +14,40 @@ AC_DEFUN([gl_FUNC_FPURGE], HAVE_FPURGE=1 # Detect BSD bug. Only cygwin 1.7 is known to be immune. AC_CACHE_CHECK([whether fpurge works], [gl_cv_func_fpurge_works], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include -]], [FILE *f = fopen ("conftest.txt", "w+"); - if (!f) return 1; - if (fputc ('a', f) != 'a') return 2; - rewind (f); - if (fgetc (f) != 'a') return 3; - if (fgetc (f) != EOF) return 4; - if (fpurge (f) != 0) return 5; - if (putc ('b', f) != 'b') return 6; - if (fclose (f) != 0) return 7; - if ((f = fopen ("conftest.txt", "r")) == NULL) return 8; - if (fgetc (f) != 'a') return 9; - if (fgetc (f) != 'b') return 10; - if (fgetc (f) != EOF) return 11; - if (fclose (f) != 0) return 12; - if (remove ("conftest.txt") != 0) return 13; - return 0;])], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include +]], + [FILE *f = fopen ("conftest.txt", "w+"); + if (!f) + return 1; + if (fputc ('a', f) != 'a') + { fclose (f); return 2; } + rewind (f); + if (fgetc (f) != 'a') + { fclose (f); return 3; } + if (fgetc (f) != EOF) + { fclose (f); return 4; } + if (fpurge (f) != 0) + { fclose (f); return 5; } + if (putc ('b', f) != 'b') + { fclose (f); return 6; } + if (fclose (f) != 0) + return 7; + if ((f = fopen ("conftest.txt", "r")) == NULL) + return 8; + if (fgetc (f) != 'a') + { fclose (f); return 9; } + if (fgetc (f) != 'b') + { fclose (f); return 10; } + if (fgetc (f) != EOF) + { fclose (f); return 11; } + if (fclose (f) != 0) + return 12; + if (remove ("conftest.txt") != 0) + return 13; + return 0; + ])], [gl_cv_func_fpurge_works=yes], [gl_cv_func_fpurge_works=no], [gl_cv_func_fpurge_works='guessing no'])]) if test "x$gl_cv_func_fpurge_works" != xyes; then