/* ----------------------------------------------------------------- * Copyright (c) 1997 Hitachi Microsoftware Systems, Inc. All rights reserved. * ----------------------------------------------------------------- */ #include "../config.h" #include "../common.h" #ifdef HAVE_STRING_H #include "string.h" #endif /* HAVE_STRING_H */ /*-----------------------------------------------------------------* =NAME= chomp - 行末の改行文字(\r, \n) をカットする =SYNOPSIS= void chomp(char *s) str - 文字列 *-----------------------------------------------------------------*/ void chomp(char *s) { char c, *p; p = s + STRLEN(s) - 1; while (c = *p, p >= s && (c == '\r' || c == '\n')) *p-- = 0; }