aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-05-14 22:17:51 +0800
committerChris Lahey <clahey@src.gnome.org>2000-05-14 22:17:51 +0800
commit623ba9a279db035339ac8ae5030683c1e79b8618 (patch)
tree82b610030315c26a99a65a006fb2bceba0cdb280
parent310189326247ec07951b30c52abc69050be5d2b9 (diff)
downloadgsoc2013-evolution-623ba9a279db035339ac8ae5030683c1e79b8618.tar.gz
gsoc2013-evolution-623ba9a279db035339ac8ae5030683c1e79b8618.tar.zst
gsoc2013-evolution-623ba9a279db035339ac8ae5030683c1e79b8618.zip
Added e_strdup_strip which returns a copy of the string with the leading
2000-05-14 Christopher James Lahey <clahey@helixcode.com> * e-util.c, e-util.h: Added e_strdup_strip which returns a copy of the string with the leading and trailing spaces removed. svn path=/trunk/; revision=3026
-rw-r--r--e-util/ChangeLog5
-rw-r--r--e-util/e-util.c18
-rw-r--r--e-util/e-util.c-861118
-rw-r--r--e-util/e-util.h2
-rw-r--r--e-util/e-util.h-290022
5 files changed, 45 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 367885919f..015d840969 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-14 Christopher James Lahey <clahey@helixcode.com>
+
+ * e-util.c, e-util.h: Added e_strdup_strip which returns a copy of
+ the string with the leading and trailing spaces removed.
+
2000-05-11 NotZed <NotZed@HelixCode.com>
* e-sexp.c (e_sexp_finalise): Destroy the g_scanner when cleaning up.
diff --git a/e-util/e-util.c b/e-util/e-util.c
index d5603d3dfa..33c10aba5c 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+#include <ctype.h>
#include "e-util.h"
@@ -45,6 +46,23 @@ g_int_compare(const void *x, const void *y)
return -1;
}
+char *
+e_strdup_strip(char *string)
+{
+ int i;
+ int length = 0;
+ int initial = 0;
+ for ( i = 0; string[i]; i++ ) {
+ if (initial == i && isspace(string[i])) {
+ initial ++;
+ }
+ if (!isspace(string[i])) {
+ length = i - initial + 1;
+ }
+ }
+ return g_strndup(string + initial, length);
+}
+
void
e_free_object_list (GList *list)
{
diff --git a/e-util/e-util.c-8611 b/e-util/e-util.c-8611
index d5603d3dfa..33c10aba5c 100644
--- a/e-util/e-util.c-8611
+++ b/e-util/e-util.c-8611
@@ -25,6 +25,7 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+#include <ctype.h>
#include "e-util.h"
@@ -45,6 +46,23 @@ g_int_compare(const void *x, const void *y)
return -1;
}
+char *
+e_strdup_strip(char *string)
+{
+ int i;
+ int length = 0;
+ int initial = 0;
+ for ( i = 0; string[i]; i++ ) {
+ if (initial == i && isspace(string[i])) {
+ initial ++;
+ }
+ if (!isspace(string[i])) {
+ length = i - initial + 1;
+ }
+ }
+ return g_strndup(string + initial, length);
+}
+
void
e_free_object_list (GList *list)
{
diff --git a/e-util/e-util.h b/e-util/e-util.h
index b8d49c9928..2043235cf7 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -34,6 +34,8 @@ typedef enum {
int g_str_compare(const void *x, const void *y);
int g_int_compare(const void *x, const void *y);
+char *e_strdup_strip(char *string);
+
void e_free_object_list (GList *list);
char *e_read_file(const char *filename);
diff --git a/e-util/e-util.h-29002 b/e-util/e-util.h-29002
index b8d49c9928..2043235cf7 100644
--- a/e-util/e-util.h-29002
+++ b/e-util/e-util.h-29002
@@ -34,6 +34,8 @@ typedef enum {
int g_str_compare(const void *x, const void *y);
int g_int_compare(const void *x, const void *y);
+char *e_strdup_strip(char *string);
+
void e_free_object_list (GList *list);
char *e_read_file(const char *filename);
01-07 10:13:33 +0800'>2006-01-071-10/+30 * phproxy --> ports/www/phproxyedwin2006-01-071-0/+1 * new port www/phproxyedwin2006-01-076-0/+85 * Backout :local tweak I mistakely put in so fetching from backup sitebland2006-01-071-2/+2 * Backout :local tweak I mistakely put in so fetching from backup sitebland2006-01-071-2/+2 * Update port: update textproc/p5-Data-FormValidator to v4.12edwin2006-01-072-4/+4 * [UPDATE] misc/krecipes to version 0.9.1, unbreak on 4.xedwin2006-01-078-110/+274 * o Make sure we are using devel/swig13 instead of devel/swig11. Therelioux2006-01-071-2/+2 * Add comment/documentation for WITH_HALFOPS option in port Makefileedwin2006-01-071-0/+1 * sysutils/portupgrade: Fix yet another infinite loop.edwin2006-01-078-4/+56 * [Maintainer-Update] multimedia/qdvdauthor 0.1.0edwin2006-01-076-16/+52 * s|USE_KDELIBS|USE_KDELIBS_VER|glofi2006-01-071-1/+1 * [UPDATE]: x11-clocks/xdaliclockedwin2006-01-071-1/+1 * Update port: graphics/irit mark broken on sparc64edwin2006-01-071-0/+1 * Update port: graphics/pixie mark broken on sparc64 6edwin2006-01-071-0/+4 * net/gift add missing dependencyedwin2006-01-072-4/+6 * [UPDATE PORT] multimedia/k9copyedwin2006-01-0736-164/+422 * It seemed that the 4.x build was generating more files than the 6.x build.edwin2006-01-072-2/+21 * ip4r -> databases/ip4rade2006-01-071-0/+1 * IP4R is a contributed PostgreSQL module that embraces and extends theade2006-01-075-0/+53 * Add 'config' to the list of directories installed by postgresql81-client,ade2006-01-078-9/+30 * - Add knobs for libvisual and gnome supportnovel2006-01-076-6/+104 * - Update to 4.5.2novel2006-01-072-13/+5 * Upgrade to avr-libc-1.4.2. Among some internal bug fixes, this addsjoerg2006-01-074-3/+11 * Remove a feature which no longer exists from pkg-descr.jylefort2006-01-071-1/+0 * We no longer suggest to send attach in mailing list, because the list usuallymezz2006-01-071-1/+1 * Update to 3.2.8mnag2006-01-076-70/+60 * Update to 2.8.17mnag2006-01-073-56/+25 * ggrab --> ports/multimedia/ggrabmarkus2006-01-071-0/+1 * Add ggrab 0.22a, which records MPEG2 streams directly from your Dbox2 overmarkus2006-01-076-0/+60 * Note that this port requires at least FreeBSD 5.3edwin2006-01-072-0/+8 * Upgrade to 2006-01-06.thierry2006-01-076-14/+16 * Bump PORTREVISION to chase the cdparanoia shared library updatemarkus2006-01-0712-12/+12 * - Use cdda_device_name of struct cdrom_drive to expose the path of the devicemarkus2006-01-073-19/+14 * - Work around a pkg-plist problem: turn all options on by default.sem2006-01-071-6/+6 * Update to 2.6.23.marcus2006-01-072-4/+4 * Fix book's entries in distinfo.lev2006-01-078-12/+40 * - Don't remove mtree created symlinkspav2006-01-071-2/+0 * Update to 0.8.7.marcus2006-01-073-4/+5 * Release to ports@demon2006-01-071-1/+1 * - Don't propose sqlite backend if PHP_VER != 5aaron2006-01-072-10/+32 * - Update patch to 20060105pav2006-01-062-4/+5 * - Update to 20060101[*].hrs2006-01-064-17/+51 * o add patch to fix double-free bug[1]mich2006-01-063-0/+18 * - Update to 4.0.3pav2006-01-063-6/+9 * - Update to 1.8.2pav2006-01-062-3/+4 * Upgrade to iReport-0.5.3.thierry2006-01-062-3/+4 * - Update to 1.3pav2006-01-062-5/+4 * Update to 1.3.8ehaupt2006-01-062-6/+10 * - Update to 0.7.0pav2006-01-064-39/+65 * Update to 0.681lth2006-01-062-4/+4 * Update to 1.0.10ehaupt2006-01-062-4/+4 * Update to 1.109lth2006-01-062-4/+4 * Upgrade to version 0.5.olgeni2006-01-063-4/+5 * Install all contributed styles (bump PORTREVISION)vs2006-01-063-7/+27 * japanese/xdtp: update to 1.1.4daichi2006-01-062-4/+4 * Upgrade to version 2.4.1.olgeni2006-01-063-4/+5 * Release to ports@demon2006-01-061-1/+1 * Honour WITHOUT_X11.vs2006-01-062-382/+397 * Update to SRC680_m148maho2006-01-0625-70/+455 * Update to 1.32erwin2006-01-062-4/+4 * Update to 2.05erwin2006-01-062-4/+4 * - Mark BROKEN on FreeBSD 4.X; does not compile without warnings, sets -Werrorpav2006-01-061-0/+4 * Fix build on amd64.novel2006-01-061-1/+1 * - Don't touch mtree symlinkspav2006-01-061-2/+0 * adocman --> ports/devel/adocmanerwin2006-01-061-0/+1 * - update to 1.4.11clsung2006-01-063-4/+5 * update port: textproc/raptor to v1.4.8edwin2006-01-066-8/+72 * Set IGNORE for FreeBSD 4.xedwin2006-01-061-1/+7 * p5-DBIx-Sequence --> ports/databases/p5-DBIx-Sequenceedwin2006-01-061-0/+1 * New port databases/p5-DBIx-Sequenceedwin2006-01-065-0/+51 * Serendipty Port is missing php4-xml-4.4.1_3edwin2006-01-062-2/+2 * p5-DBIx-Abstract --> ports/databases/p5-DBIx-Abstractedwin2006-01-061-0/+1 * New port databases/p5-DBIx-Abstractedwin2006-01-065-0/+58 * * Update to 1.4.2marcus2006-01-065-56/+65 * py-flac --> ports/audio/py-flacedwin2006-01-061-0/+1 * New port: audio/py-flac, Python module that provides the Freeedwin2006-01-066-0/+71 * [UPDATE]: security/md5deep: Update to version 1.9.3edwin2006-01-062-4/+4 * [MAINTAINER] www/p5-HTML-Prototype: up to 1.40edwin2006-01-062-4/+4 * Update to 2.0.9edwin2006-01-063-9/+27 * Update to 1.2.7.marcus2006-01-062-4/+4 * Update to 1.0.2.marcus2006-01-062-4/+4 * - update to 4.11leeym2006-01-062-9/+9 * Upgrade to 1.8.0ache2006-01-062-7/+8 * - update to 1.17leeym2006-01-062-18/+9 * - add missing optional dependency URI in BUILD_DEPENDSleeym2006-01-061-1/+2 * - remove IGNORE on old perlleeym2006-01-061-3/+8 * - postgrey is compatibile with Berkeley-DB < 4.1 since postgrey-1.23leeym2006-01-063-35/+8 * Drop maintainership. :<cjh2006-01-061-1/+1 * - update to 0.52leeym2006-01-063-4/+5 * IGNORE since the dependency list reported by 'make describe' somehowkris2006-01-061-0/+2 * Add a note about a script to migrate Kronolith's back-end from MCALthierry2006-01-061-0/+9 * - Replace WITH_APACHE2 by USE_APACHE, rename httpd.conf.xxx tothierry2006-01-0686-275/+508 * - Fix SSL optionpav2006-01-061-2/+6 * - Update to 2.8.5pav2006-01-0625-355/+515 * - Fix permissions on datafilespav2006-01-062-1/+3 * - Update to 21.9pav2006-01-064-14/+18 * - Remove symlinks that belong to mtreepav2006-01-062-4/+0 * two additional slirp patches for emulators/qemuedwin2006-01-066-4/+168 * - Update to 0.4.8pav2006-01-063-7/+13 * - Update tp 0.8.6hsem2006-01-0614