aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-09-02 17:26:13 +0800
committerChris Lahey <clahey@src.gnome.org>2001-09-02 17:26:13 +0800
commit5c1e0a1d9eea2d08e4d10c313f86c8eb634eaf4f (patch)
tree1029012ad90364f18cc73ddff1c1887dd06c2ca6
parent85a5fb5bce5644bf1a5f963549043ba63e5d060f (diff)
downloadgsoc2013-evolution-5c1e0a1d9eea2d08e4d10c313f86c8eb634eaf4f.tar.gz
gsoc2013-evolution-5c1e0a1d9eea2d08e4d10c313f86c8eb634eaf4f.tar.zst
gsoc2013-evolution-5c1e0a1d9eea2d08e4d10c313f86c8eb634eaf4f.zip
Strip spaces at the beginning or end as well as changing " " to " ". Fixes
2001-09-02 Christopher James Lahey <clahey@ximian.com> * e-cell-date.c (ecd_get_text): Strip spaces at the beginning or end as well as changing " " to " ". Fixes Ximian bug #7683. svn path=/trunk/; revision=12560
-rw-r--r--widgets/table/e-cell-date.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c
index c8e2dd5f09..2c1873ae90 100644
--- a/widgets/table/e-cell-date.c
+++ b/widgets/table/e-cell-date.c
@@ -5,13 +5,16 @@
*/
#include <config.h>
+
+#include "e-cell-date.h"
+
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
+#include <string.h>
#include <gal/util/e-util.h>
#include <gal/widgets/e-unicode.h>
#include <gal/util/e-i18n.h>
-#include "e-cell-date.h"
#define PARENT_TYPE e_cell_text_get_type ()
@@ -25,6 +28,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row)
time_t yesdate;
struct tm then, now, yesterday;
char buf[26];
+ char *temp, *ret_val;
gboolean done = FALSE;
if (date == 0) {
@@ -93,8 +97,14 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row)
ctime_r (&date, buf);
#endif
#endif
-
- return e_utf8_from_locale_string (buf);
+ temp = buf;
+ while ((temp = strstr (temp, " "))) {
+ memmove (temp, temp + 1, strlen (temp));
+ }
+ temp = e_strdup_strip (buf);
+ ret_val = e_utf8_from_locale_string (temp);
+ g_free (temp);
+ return ret_val;
}
static void