From 20ed5784057ac6e131c57f3a4bb089abd5f53d08 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Wed, 4 Aug 2004 04:06:19 +0000 Subject: [PATCH] truncsp() and truncnl() now defined in truncsp.c. --- src/xpdev/csv_file.c | 12 +----------- src/xpdev/ini_file.c | 24 +----------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/src/xpdev/csv_file.c b/src/xpdev/csv_file.c index 492ba3edb7..8b1c3eea90 100644 --- a/src/xpdev/csv_file.c +++ b/src/xpdev/csv_file.c @@ -133,17 +133,7 @@ str_list_t csvCreate(str_list_t records[], str_list_t columns) return(list); } -/****************************************************************************/ -/* Truncates all white-space chars off end of 'str' */ -/****************************************************************************/ -static void truncsp(char *str) -{ - uint c; - - c=strlen(str); - while(c && (uchar)str[c-1]<=' ') c--; - str[c]=0; -} +#include "truncsp.c" str_list_t csvParseLine(char* line) { diff --git a/src/xpdev/ini_file.c b/src/xpdev/ini_file.c index 6d86c1079c..0b4d2b709d 100644 --- a/src/xpdev/ini_file.c +++ b/src/xpdev/ini_file.c @@ -53,29 +53,7 @@ static ini_style_t default_style; -/****************************************************************************/ -/* Truncates all white-space chars off end of 'str' */ -/****************************************************************************/ -static void truncsp(char *str) -{ - uint c; - - c=strlen(str); - while(c && (uchar)str[c-1]<=' ') c--; - str[c]=0; -} - -/****************************************************************************/ -/* Truncates carriage-return and line-feed chars off end of 'str' */ -/****************************************************************************/ -static void truncnl(char *str) -{ - uint c; - - c=strlen(str); - while(c && (str[c-1]=='\r' || str[c-1]=='\n')) c--; - str[c]=0; -} +#include "truncsp.c" /* truncsp() and truncnl() */ static char* section_name(char* p) { -- GitLab