Diffstat (limited to 'mcon/U/d_scannl.U')
1 files changed, 74 insertions, 0 deletions
diff --git a/mcon/U/d_scannl.U b/mcon/U/d_scannl.U
new file mode 100644
@@ -0,0 +1,74 @@
+?RCS: $Id: d_scannl.U,v 126.96.36.199 1997/02/28 15:41:27 ram Exp $
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS: $Log: d_scannl.U,v $
+?RCS: Revision 188.8.131.52 1997/02/28 15:41:27 ram
+?RCS: patch61: added ?F: metalint hint
+?RCS: Revision 184.108.40.206 1995/07/25 13:59:12 ram
+?RCS: patch56: made cc and ccflags optional dependencies
+?RCS: Revision 3.0 1993/08/18 12:07:00 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?X: Does the scanf routine read "\n" corretly ? This is was not
+?X: the case on AIX...
+?MAKE:d_scannl: cat +cc +ccflags rm Setvar
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines SCAN_NL, which indicates
+?S: wether the C library routines scanf() and friends can deal with
+?S: a '\n' in the input correctly. They do most of the time.
+?C: This symbol is defined if the C library routines scanf() and friends
+?C: can deal with a '\n' in the input correctly, so that you can say
+?C: scanf("%d\n"); instead of scanf("%d"); getc(c); to handle the '\n'.
+?H:#$d_scannl SCAN_NL /* scanf("%d\n") works */
+: does scanf handle "\n" correctly ?
+echo " "
+?X: I really want to say "\n" instead of '\n', becasue I am refering
+?X: to the string given as argument to scanf().
+echo 'Let'"'"'s see if scanf() handles "\\n" correctly...' >&4
+$cat >try.c <<'EOCP'
+ int i = 0, j = 0;
+ scanf("%d\n%d", &i, &j);
+ if (j != 3)
+if $cc -o try $ccflags try.c >/dev/null 2>&1; then
+ if ./try <<'EOD'
+ echo "Yes, it does."
+ echo "No, it doesn't."
+ echo "(I can't seem to compile the test program. Assuming it does.)"
+$rm -f try.* try