blob: cb92befb1d840002bf3db8aa0c90af9367f91b82 [file] [log] [blame]
Eric Andersenaad1a882001-03-16 22:47:14 +00001/* vi: set sw=4 ts=4: */
2/*
3 * Utility routines.
4 *
Eric Andersenc7bda1c2004-03-15 08:29:22 +00005 * Copyright (C) many different people.
Eric Andersencb81e642003-07-14 21:21:08 +00006 * If you wrote this, please acknowledge your work.
Eric Andersenaad1a882001-03-16 22:47:14 +00007 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02008 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Eric Andersenaad1a882001-03-16 22:47:14 +00009 */
10
Eric Andersenaad1a882001-03-16 22:47:14 +000011#include "libbb.h"
12
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000013void FAST_FUNC chomp(char *s)
Eric Andersenaad1a882001-03-16 22:47:14 +000014{
Matt Kraai0733e842002-01-02 18:51:23 +000015 char *lc = last_char_is(s, '\n');
Eric Andersenc7bda1c2004-03-15 08:29:22 +000016
Denis Vlasenko067e3f02006-11-10 23:25:53 +000017 if (lc)
Denis Vlasenko7e84e532007-05-08 17:52:17 +000018 *lc = '\0';
Eric Andersenaad1a882001-03-16 22:47:14 +000019}