path: root/mcon/U/d_scannl.U
diff options
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
index 0000000..70b0321
--- /dev/null
+++ b/mcon/U/d_scannl.U
@@ -0,0 +1,74 @@
+?RCS: $Id: d_scannl.U,v 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 1997/02/28 15:41:27 ram
+?RCS: patch61: added ?F: metalint hint
+?RCS: Revision 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 */
+?LINT:set d_scannl
+: 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)
+ exit(1);
+ exit(0);
+if $cc -o try $ccflags try.c >/dev/null 2>&1; then
+ if ./try <<'EOD'
+ then
+ echo "Yes, it does."
+ else
+ echo "No, it doesn't."
+ val="$undef"
+ fi
+ echo "(I can't seem to compile the test program. Assuming it does.)"
+set d_scannl
+eval $setvar
+$rm -f try.* try