DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T v

⟦5201a0310⟧ TextFile

    Length: 561 (0x231)
    Types: TextFile
    Names: »vecho.c«

Derivation

└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
    └─⟦3658e588a⟧ »EurOpenD3/mail/mh/mh-6.7.tar.Z« 
        └─⟦c75e36ecb⟧ 
            └─⟦this⟧ »mh-6.7/miscellany/less-5.0/vecho.c« 

TextFile

/*
 * This dumb little program emulates the System V "echo" command,
 * to accomodate BSD systems which don't understand the \c escape,
 * meaning don't echo a newline.  BSD uses "echo -n".
 */

#include <stdio.h>

int putnl;

main(argc, argv)
	int argc;
	char *argv[];
{
	putnl = 1;
	while (--argc > 0)
	{
		vecho(*++argv);
		if (argc > 1)
			putchar(' ');
	}
	if (putnl)
		putchar('\n');
}

vecho(str)
	char *str;
{
	register char *s;

	for (s = str;  *s != '\0';  s++)
	{
		if (*s == '\\' && s[1] == 'c')
		{
			putnl = 0;
			return;
		}
		putchar(*s);
	}
}