[Pkg-wmaker-commits] [wmbiff] 04/14: Mark's wmbiffrc parsing fix, small Makefile changes and bump version to 0.3.0.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Thu Aug 20 02:59:54 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to tag wmbiff_0_3_1
in repository wmbiff.
commit c5873830a69f751544d4cef2faff292c6660d536
Author: oskuro <oskuro>
Date: Fri May 11 15:04:08 2001 +0000
Mark's wmbiffrc parsing fix, small Makefile changes and bump version to 0.3.0.
---
ChangeLog | 14 +++++++++++---
wmbiff/Imap4Client.c | 2 --
wmbiff/Makefile | 5 +++--
wmbiff/charutil.c | 42 ++++++++++++++++++++++++++++++++++++++++++
wmbiff/charutil.h | 14 ++++++++++++++
wmbiff/wmbiff.c | 33 +++++++++++++++++++++------------
6 files changed, 91 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a4c928e..b01f1cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
-wmBiff (0.2r)
- * wmbiff/Makefile: little cosmetic changes.
+wmBiff (0.3.0)
+ * wmbiff/Makefile:
+ + added charutil.o to OBJS (Mark Hurley).
+ + little cosmetic changes and remove wmbiff-master.xpm.
+ * wmbiff/Imap4Client.c: removed two unused variables in imap4CheckMail
+ (Mark Hurley).
+ * wmbiff/charutil.c: added for TrimLeft, TrimRight, TrimFull (also .h)
+ (Mark Hurley).
+ * wmbiff/wmbiff.c: [ReadLine] removed previous trim leading spaces, added
+ TrimFull. Fixes Debian Bug #95849 (Mark Hurley).
* wmbiff/wmbiff.c: if a pop3 or imap mailbox read fails and the following
reads are successful but no mail was in the server, the given mailbox
would remain reading "XX". Now it updates the counter no matter what the
@@ -9,7 +17,7 @@ wmBiff (0.2r)
* wmbiff/Imap4Client.c: fixed reading of quoted imap folders, which some
IMAPd's do (Rob Funk).
- -- Jordi Mallach <jordi at sindominio.net> Fri, 4 May 2001 13:01:14 +0200
+ -- Jordi Mallach <jordi at sindominio.net> Fri, 11 May 2001 17:02:44 +0200
wmBiff (0.2q1)
* wmbiff/Client.h: move DEBUG_* macros to wmbiff/Makefile
diff --git a/wmbiff/Imap4Client.c b/wmbiff/Imap4Client.c
index f558dd1..68fb2e9 100644
--- a/wmbiff/Imap4Client.c
+++ b/wmbiff/Imap4Client.c
@@ -49,8 +49,6 @@ FILE *imap4Login(Pop3 pc)
int imap4CheckMail(Pop3 pc)
{
FILE *f;
- char str[128];
- char buf[BUF_SIZE];
f = pc->open(pc);
if (f == NULL)
diff --git a/wmbiff/Makefile b/wmbiff/Makefile
index 46917cd..3b59e4d 100644
--- a/wmbiff/Makefile
+++ b/wmbiff/Makefile
@@ -1,4 +1,4 @@
-WMBIFF_VERSION="0.2r"
+WMBIFF_VERSION="0.3.0"
DESTDIR=
prefix=/usr/local
bindir=${prefix}/bin
@@ -18,7 +18,8 @@ OBJS = wmbiff.o socket.o \
maildirClient.o \
../wmgeneral/wmgeneral.o \
../wmgeneral/misc.o \
- ../wmgeneral/list.o
+ ../wmgeneral/list.o \
+ charutil.o
INSTALL = /usr/bin/install
INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755
diff --git a/wmbiff/charutil.c b/wmbiff/charutil.c
new file mode 100644
index 0000000..eb1dadd
--- /dev/null
+++ b/wmbiff/charutil.c
@@ -0,0 +1,42 @@
+//include <stdio.h>
+#include <stdlib.h>
+//include <ctype.h>
+
+#include "charutil.h"
+
+inline int LeftTrim(char *psValue)
+{
+
+ char *psTmp = psValue;
+
+ while (*psTmp == ' ' || *psTmp == '\t')
+ psTmp++;
+
+ strcpy(psValue, psTmp);
+
+ return EXIT_SUCCESS;
+}
+
+inline int RightTrim(char *psValue)
+{
+
+ long lLength = strlen(psValue) - 1;
+
+ while ((psValue[lLength] == ' ' || psValue[lLength] == '\t')
+ && *psValue) {
+ lLength--;
+ }
+
+ psValue[++lLength] = '\000';
+ return EXIT_SUCCESS;
+}
+
+inline int FullTrim(char *psValue)
+{
+
+ if (LeftTrim(psValue) != 0)
+ return EXIT_FAILURE;
+ if (RightTrim(psValue) != 0)
+ return EXIT_FAILURE;
+ return EXIT_SUCCESS;
+}
diff --git a/wmbiff/charutil.h b/wmbiff/charutil.h
new file mode 100644
index 0000000..a10a89c
--- /dev/null
+++ b/wmbiff/charutil.h
@@ -0,0 +1,14 @@
+/* Author: Mark Hurley (debian4tux at telocity.com)
+ *
+ * Simple char util's to trim char string arrays
+ *
+ */
+
+#ifndef CHARUTIL
+#define CHARUTIL
+
+inline int LeftTrim(char *psValue);
+inline int RightTrim(char *psValue);
+inline int FullTrim(char *psValue);
+
+#endif
diff --git a/wmbiff/wmbiff.c b/wmbiff/wmbiff.c
index d2713cd..5fa5760 100644
--- a/wmbiff/wmbiff.c
+++ b/wmbiff/wmbiff.c
@@ -21,6 +21,7 @@
#include "../wmgeneral/misc.h"
#include "Client.h"
+#include "charutil.h"
#include "wmbiff-master.xpm"
char wmbiff_mask_bits[64 * 64];
@@ -325,16 +326,16 @@ int count_mail(int item)
}
if (mbox[item].checkMail(&(mbox[item])) < 0) {
- /* we failed to obtain any numbers
- * therefore set them to -1's
- * ensuring the next pass (even if zero)
- * will be captured correctly
- */
- mbox[item].TotalMsgs = -1;
- mbox[item].UnreadMsgs = -1;
- mbox[item].OldMsgs = -1;
- mbox[item].OldUnreadMsgs = -1;
- return -1;
+ /* we failed to obtain any numbers
+ * therefore set them to -1's
+ * ensuring the next pass (even if zero)
+ * will be captured correctly
+ */
+ mbox[item].TotalMsgs = -1;
+ mbox[item].UnreadMsgs = -1;
+ mbox[item].OldMsgs = -1;
+ mbox[item].OldUnreadMsgs = -1;
+ return -1;
}
if (mbox[item].UnreadMsgs > mbox[item].OldUnreadMsgs &&
@@ -431,8 +432,16 @@ int ReadLine(FILE * fp, char *setting, char *value, int *index)
return -1;
if (!(q = strtok(NULL, "\n")))
return -1;
- for (; (*p == ' ' || *p == '\t') && *p; p++); /* Skip leading spaces */
- for (; (*q == ' ' || *q == '\t') && *q; q++); /* Skip leading spaces */
+
+ /* Chg - Mark Hurley
+ * Date: May 8, 2001
+ * Removed for loop (which removed leading spaces)
+ * Leading & Trailing spaces need to be removed
+ * to Fix Debian bug #95849
+ */
+ FullTrim(p);
+ FullTrim(q);
+
strcpy(setting, p);
strcpy(value, q);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git
More information about the Pkg-wmaker-commits
mailing list