Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/src/cmd/refer/str.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include "def.h"

void trimnl(char *p)
{
	if ((p = strchr(p, '\n')) != 0)
		*p = '\0';
}

int prefix(char *t, char *s)
{
	int c;

	while ((c = *t++) != 0)
		if (c != *s++)
			return 0;
	return 1;
}

char *mindex(char *s, int c)
{
	return c==0? 0: strchr(s, c);
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].