Update to version 4.1

- resolves #1260893
This commit is contained in:
Nikola Forró 2015-09-10 12:38:51 +02:00
parent 07c3bdee35
commit 935db735fe
6 changed files with 73 additions and 79 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
/joe-3.8.tar.gz
/joe-4.0.tar.gz
/joe-4.1.tar.gz

View File

@ -13,23 +13,23 @@ diff --git a/joe/cmd.c b/joe/cmd.c
index 863edb9..150c1a5 100644
--- a/joe/cmd.c
+++ b/joe/cmd.c
@@ -235,7 +235,7 @@ int steal_lock(BW *bw,int c,B *b,int *notify)
@@ -235,7 +235,7 @@ static int steal_lock(W *w,int c,void *object,int *notify)
if(bf1[0])
joe_snprintf_1(bf,sizeof(bf),joe_gettext(LOCKMSG1),bf1);
joe_snprintf_1(bf,SIZEOF(bf),joe_gettext(LOCKMSG1),bf1);
else
- joe_snprintf_0(bf, sizeof(bf), joe_gettext(LOCKMSG2));
+ joe_snprintf_1(bf,sizeof(bf),"%s",joe_gettext(LOCKMSG2));
if (mkqw(bw->parent, sz(bf), steal_lock, NULL, b, notify)) {
- joe_snprintf_0(bf, SIZEOF(bf), joe_gettext(LOCKMSG2));
+ joe_snprintf_1(bf,SIZEOF(bf),"%s",joe_gettext(LOCKMSG2));
if (mkqw(w, sz(bf), steal_lock, NULL, b, notify)) {
return 0;
} else {
@@ -293,7 +293,7 @@ int try_lock(BW *bw,B *b)
if(bf1[0])
joe_snprintf_1(bf,sizeof(bf),joe_gettext(LOCKMSG1),bf1);
joe_snprintf_1(bf,SIZEOF(bf),joe_gettext(LOCKMSG1),bf1);
else
- joe_snprintf_0(bf, sizeof(bf), joe_gettext(LOCKMSG2));
+ joe_snprintf_1(bf,sizeof(bf),"%s",joe_gettext(LOCKMSG2));
- joe_snprintf_0(bf, SIZEOF(bf), joe_gettext(LOCKMSG2));
+ joe_snprintf_1(bf,SIZEOF(bf),"%s",joe_gettext(LOCKMSG2));
if (mkqw(bw->parent, sz(bf), steal_lock, NULL, b, NULL)) {
uquery(bw);
uquery(bw->parent, 0);
if (!b->locked)
diff --git a/joe/uerror.c b/joe/uerror.c
index ab58908..8e112b5 100644
@ -37,18 +37,18 @@ index ab58908..8e112b5 100644
+++ b/joe/uerror.c
@@ -327,7 +327,7 @@ int parserrb(B *b)
if (n)
joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("%d messages found")), n);
joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("%d messages found")), (int)n);
else
- joe_snprintf_0(msgbuf, sizeof(msgbuf), joe_gettext(_("No messages found")));
- joe_snprintf_0(msgbuf, SIZEOF(msgbuf), joe_gettext(_("No messages found")));
+ joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, "%s", joe_gettext(_("No messages found")));
msgnw(bw->parent, msgbuf);
return 0;
}
@@ -341,7 +341,7 @@ int uparserr(BW *bw)
@@ -341,7 +341,7 @@ int uparserr(W *w, int k)
if (n)
joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("%d messages found")), n);
joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("%d messages found")), (int)n);
else
- joe_snprintf_0(msgbuf, sizeof(msgbuf), joe_gettext(_("No messages found")));
- joe_snprintf_0(msgbuf, SIZEOF(msgbuf), joe_gettext(_("No messages found")));
+ joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, "%s", joe_gettext(_("No messages found")));
msgnw(bw->parent, msgbuf);
return 0;
@ -57,17 +57,17 @@ diff --git a/joe/ufile.c b/joe/ufile.c
index e0f7754..347ff66 100644
--- a/joe/ufile.c
+++ b/joe/ufile.c
@@ -62,11 +62,11 @@ void genexmsgmulti(BW *bw, int saved, int skipped)
@@ -62,11 +62,11 @@ static void genexmsgmulti(BW *bw, int saved, int skipped)
{
if (saved)
if (skipped)
- joe_snprintf_0(msgbuf, sizeof(msgbuf), joe_gettext(_("Some files have not been saved.")));
- joe_snprintf_0(msgbuf, SIZEOF(msgbuf), joe_gettext(_("Some files have not been saved.")));
+ joe_snprintf_0(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("Some files have not been saved.")));
else
- joe_snprintf_0(msgbuf, sizeof(msgbuf), joe_gettext(_("All modified files have been saved.")));
- joe_snprintf_0(msgbuf, SIZEOF(msgbuf), joe_gettext(_("All modified files have been saved.")));
+ joe_snprintf_0(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("All modified files have been saved.")));
else
- joe_snprintf_0(msgbuf, sizeof(msgbuf), joe_gettext(_("No modified files, so no updates needed.")));
- joe_snprintf_0(msgbuf, SIZEOF(msgbuf), joe_gettext(_("No modified files, so no updates needed.")));
+ joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, "%s", joe_gettext(_("No modified files, so no updates needed.")));
msgnw(bw->parent, msgbuf);

View File

@ -11,77 +11,77 @@ diff --git a/joe/uformat.c b/joe/uformat.c
index 8e1caa8..e552896 100644
--- a/joe/uformat.c
+++ b/joe/uformat.c
@@ -330,6 +330,7 @@ void wrapword(BW *bw, P *p, long int indent, int french, int no_over, unsigned c
@@ -330,6 +330,7 @@ void wrapword(BW *bw, P *p, off_t indent, int french, int no_over, char *indent
int c;
long to = p->byte;
off_t to = p->byte;
int my_indents = 0;
+ off_t indents_size = 0;
/* autoindent when called by utype */
if (!indents) {
@@ -347,7 +348,8 @@ void wrapword(BW *bw, P *p, long int indent, int french, int no_over, unsigned c
@@ -347,7 +348,8 @@ void wrapword(BW *bw, P *p, off_t indent, int french, int no_over, char *indent
indent = nindent(bw, q, 0);
pcol(r, indent);
- indents = brs(q, r->byte - q->byte);
+ indents_size = r->byte - q->byte;
pcol(tr, indent);
- indents = brs(q, tr->byte - q->byte); /* Risky */
+ indents_size = tr->byte - q->byte;
+ indents = brs(q, indents_size);
prm(r);
prm(tr);
} else {
/* First line */
@@ -356,7 +358,8 @@ void wrapword(BW *bw, P *p, long int indent, int french, int no_over, unsigned c
@@ -356,7 +358,8 @@ void wrapword(BW *bw, P *p, off_t indent, int french, int no_over, char *indent
indent = nindent(bw, s, 1);
pcol(r, indent);
- indents = brs(s, r->byte - s->byte);
+ indents_size = r->byte - s->byte;
pcol(tr, indent);
- indents = brs(s, tr->byte - s->byte); /* Risky */
+ indents_size = tr->byte - s->byte;
+ indents = brs(s, indents_size);
prm(r);
prm(tr);
if (!bw->o.autoindent) {
/* Don't indent second line of single-line paragraphs if autoindent is off */
@@ -364,7 +367,7 @@ void wrapword(BW *bw, P *p, long int indent, int french, int no_over, unsigned c
int orgx = x;
while (x && (indents[x - 1] == ' ' || indents[x - 1] == '\t'))
indents[--x] = 0;
- if (x && orgx != x) {
+ if (x && orgx != x && (x < indents_size)) {
indents[x++] = ' ';
indents[x] = 0;
@@ -364,7 +367,7 @@ void wrapword(BW *bw, P *p, off_t indent, int french, int no_over, char *indent
ptrdiff_t orgx = tx;
while (tx && (indents[tx - 1] == ' ' || indents[tx - 1] == '\t'))
indents[--tx] = 0;
- if (tx && orgx != tx) {
+ if (tx && orgx != tx && (tx < indents_size)) {
indents[tx++] = ' ';
indents[tx] = 0;
}
@@ -523,6 +526,7 @@ int uformat(BW *bw)
long curoff;
int c;
P *p, *q;
@@ -523,6 +526,7 @@ int uformat(W *w, int k)
BW *bw;
WIND_BW(bw, w);
int flag;
+ off_t indents_size = 0;
p = pdup(bw->cursor, USTR "uformat");
p = pdup(bw->cursor, "uformat");
p_goto_bol(p);
@@ -553,21 +557,23 @@ int uformat(BW *bw)
@@ -553,21 +557,23 @@ int uformat(W *w, int k)
indent = nindent(bw, q, 0);
pcol(r, indent);
- indents = brs(q, r->byte - q->byte);
- indents = brs(q, r->byte - q->byte); /* Risky */
+ indents_size = r->byte - q->byte;
+ indents = brs(q, indents_size);
prm(r);
} else {
P *r = pdup(p, USTR "uformat");
int x, y;
P *r = pdup(p, "uformat");
ptrdiff_t x, y;
indent = nindent(bw, p, 1); /* allowing * and - here */
pcol(r, indent);
- indents = brs(p, r->byte - p->byte);
- indents = brs(p, r->byte - p->byte); /* Risky */
+ indents_size = r->byte - p->byte;
+ indents = brs(p, indents_size);
prm(r);
if (!bw->o.autoindent) {
/* Don't indent second line of single-line paragraphs if autoindent is off */
int x = zlen(indents);
while (x && (indents[x - 1] == ' ' || indents[x - 1] == '\t'))
indents[--x] = 0;
- if (x) {
+ if ((x) && (x < indents_size)) {
indents[x++] = ' ';
indents[x] = 0;
ptrdiff_t tx = zlen(indents);
while (tx && (indents[tx - 1] == ' ' || indents[tx - 1] == '\t'))
indents[--tx] = 0;
- if (tx) {
+ if ((tx) && (tx < indents_size)) {
indents[tx++] = ' ';
indents[tx] = 0;
}
--
1.9.3

View File

@ -57,33 +57,33 @@ index 953e0fd..8bdbb0a 100644
return 1;
}
@@ -63,7 +63,7 @@ copy_security_context(const char *from_file, const char *to_file)
int
match_default_security_context(const char *from_file)
int match_default_security_context(const char *from_file)
{
-#ifdef WITH_SELINUX
+#ifdef HAVE_SELINUX
security_context_t scontext;
if (selinux_enabled == -1)
@@ -102,7 +102,7 @@ match_default_security_context(const char *from_file)
int
reset_default_security_context()
@@ -102,7 +102,7 @@ int match_default_security_context(const char *from_file)
int reset_default_security_context()
{
-#ifdef WITH_SELINUX
+#ifdef HAVE_SELINUX
if (selinux_enabled == -1)
selinux_enabled = (is_selinux_enabled() > 0);
@@ -121,7 +121,7 @@ reset_default_security_context()
int
output_security_context(char *from_file)
@@ -121,7 +121,7 @@ int reset_default_security_context()
int output_security_context(const char *from_file)
{
-#ifdef WITH_SELINUX
+#ifdef HAVE_SELINUX
security_context_t scontext;
if (selinux_enabled == -1)
@@ -153,7 +153,7 @@ output_security_context(char *from_file)
@@ -153,7 +153,7 @@ int output_security_context(const char *from_file)
/*
Test program compile using the following command
@ -96,17 +96,8 @@ diff --git a/joe/ufile.c b/joe/ufile.c
index fe3c252..e0f7754 100644
--- a/joe/ufile.c
+++ b/joe/ufile.c
@@ -15,7 +15,7 @@
#endif
#endif
-#ifdef WITH_SELINUX
+#ifdef HAVE_SELINUX
int copy_security_context(const char *from_file, const char *to_file);
#endif
@@ -157,7 +157,7 @@ static int cp(unsigned char *from, unsigned char *to)
utime((char *)to, &utbuf);
@@ -157,7 +157,7 @@ static int cp(char *from, char *to)
utime(to, &utbuf);
#endif
-#ifdef WITH_SELINUX

View File

@ -1,6 +1,6 @@
Summary: An easy to use, modeless text editor
Name: joe
Version: 4.0
Version: 4.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/Editors
@ -67,6 +67,10 @@ popd
%{_datadir}/%{name}
%changelog
* Tue Sep 08 2015 Nikola Forró <nforro@redhat.com> - 4.1-1
- Update to version 4.1
resolves #1260893
* Thu Aug 20 2015 Jon Ciesla <limburgher@gmail.com> - 4.0-1
- Lastest upstream.

View File

@ -1 +1 @@
3c3b6d5089a29ddc746ee89bab59286e joe-4.0.tar.gz
b8c9ab4295e3208ddbbaa9c1141564f9 joe-4.1.tar.gz