[comp.os.vms] C printf and PHOTO

sshurr@lucy.wellesley.EDU (Scott) (01/21/88)

We are having the following problem with the PHOTO program running on
VMS 4.5:

I write a C program that does printf's, such as the following:

#include stdio

main()
{
printf("Here is a line followed by two returns.\n\n");
printf("Here is another line.\n");
}

When I run it normally, it does what I would expect, as in:
$ RUN TEST
Here is a line followed by two returns.

Here is another line.
$

But when I start up PHOTO, run the program, and exit PHOTO, I see:
$ TYPE PHOTO.LOG
Here is a line followed by two returns.
Here is another line.

So, where did that second \n go to?  Is there something special I must put
into my c programs to make PHOTO capture their output correctly?  Or is this
a bug in PHOTO itself or in the pseudo-terminal driver it uses?

Just out of curiosity, I tried running this program after doing:
$ SET HOST 0/LOG
With the following result:
$ TYPE SETHOST.LOG
Here is a line followed by two returns.


Here is another line.
That's right, the log had an EXTRA blank line!

Can anyone explain this behavior and/or suggest a solution?
Thanks,
--Scott Shurr
  sshurr@lucy.wellesley.edu