Blame rpm-4.4.2-query-flushbuffer.patch
|
Paul Nasrat |
7086a3 |
--- rpm-4.4.2/lib/query.c.flush 2006-10-31 12:48:54.000000000 +0000
|
|
Paul Nasrat |
7086a3 |
+++ rpm-4.4.2/lib/query.c 2006-10-31 12:49:05.000000000 +0000
|
|
Paul Nasrat |
7086a3 |
@@ -124,6 +124,28 @@
|
|
Paul Nasrat |
7086a3 |
return str;
|
|
Paul Nasrat |
7086a3 |
}
|
|
Paul Nasrat |
7086a3 |
|
|
Paul Nasrat |
7086a3 |
+/**
|
|
Paul Nasrat |
7086a3 |
+ */
|
|
Paul Nasrat |
7086a3 |
+static void flushBuffer(char ** tp, char ** tep, int nonewline)
|
|
Paul Nasrat |
7086a3 |
+ /*@ modifies *tp, *tep @*/
|
|
Paul Nasrat |
7086a3 |
+{
|
|
Paul Nasrat |
7086a3 |
+ char *t, *te;
|
|
Paul Nasrat |
7086a3 |
+
|
|
Paul Nasrat |
7086a3 |
+ t = *tp;
|
|
Paul Nasrat |
7086a3 |
+ te = *tep;
|
|
Paul Nasrat |
7086a3 |
+ if (te > t) {
|
|
Paul Nasrat |
7086a3 |
+ if (!nonewline) {
|
|
Paul Nasrat |
7086a3 |
+ *te++ = '\n';
|
|
Paul Nasrat |
7086a3 |
+ *te = '\0';
|
|
Paul Nasrat |
7086a3 |
+ }
|
|
Paul Nasrat |
7086a3 |
+ rpmMessage(RPMMESS_NORMAL, "%s", t);
|
|
Paul Nasrat |
7086a3 |
+ te = t;
|
|
Paul Nasrat |
7086a3 |
+ *t = '\0';
|
|
Paul Nasrat |
7086a3 |
+ }
|
|
Paul Nasrat |
7086a3 |
+ *tp = t;
|
|
Paul Nasrat |
7086a3 |
+ *tep = te;
|
|
Paul Nasrat |
7086a3 |
+}
|
|
Paul Nasrat |
7086a3 |
+
|
|
Paul Nasrat |
7086a3 |
int showQueryPackage(QVA_t qva, rpmts ts, Header h)
|
|
Paul Nasrat |
7086a3 |
{
|
|
Paul Nasrat |
7086a3 |
int scareMem = 0;
|
|
Paul Nasrat |
7086a3 |
@@ -131,7 +153,6 @@
|
|
Paul Nasrat |
7086a3 |
char * t, * te;
|
|
Paul Nasrat |
7086a3 |
char * prefix = NULL;
|
|
Paul Nasrat |
7086a3 |
int rc = 0; /* XXX FIXME: need real return code */
|
|
Paul Nasrat |
7086a3 |
- int nonewline = 0;
|
|
Paul Nasrat |
7086a3 |
int i;
|
|
Paul Nasrat |
7086a3 |
|
|
Paul Nasrat |
7086a3 |
te = t = xmalloc(BUFSIZ);
|
|
Paul Nasrat |
7086a3 |
@@ -141,7 +162,6 @@
|
|
Paul Nasrat |
7086a3 |
|
|
Paul Nasrat |
7086a3 |
if (qva->qva_queryFormat != NULL) {
|
|
Paul Nasrat |
7086a3 |
const char * str = queryHeader(h, qva->qva_queryFormat);
|
|
Paul Nasrat |
7086a3 |
- nonewline = 1;
|
|
Paul Nasrat |
7086a3 |
/*@-branchstate@*/
|
|
Paul Nasrat |
7086a3 |
if (str) {
|
|
Paul Nasrat |
7086a3 |
size_t tb = (te - t);
|
|
Paul Nasrat |
7086a3 |
@@ -157,6 +177,7 @@
|
|
Paul Nasrat |
7086a3 |
/*@=usereleased@*/
|
|
Paul Nasrat |
7086a3 |
/*@=boundswrite@*/
|
|
Paul Nasrat |
7086a3 |
str = _free(str);
|
|
Paul Nasrat |
7086a3 |
+ flushBuffer(&t, &te, 1);
|
|
Paul Nasrat |
7086a3 |
}
|
|
Paul Nasrat |
7086a3 |
/*@=branchstate@*/
|
|
Paul Nasrat |
7086a3 |
}
|
|
Paul Nasrat |
7086a3 |
@@ -304,31 +325,13 @@
|
|
Paul Nasrat |
7086a3 |
_("package has neither file owner or id lists\n"));
|
|
Paul Nasrat |
7086a3 |
}
|
|
Paul Nasrat |
7086a3 |
}
|
|
Paul Nasrat |
7086a3 |
-/*@-branchstate@*/
|
|
Paul Nasrat |
7086a3 |
- if (te > t) {
|
|
Paul Nasrat |
7086a3 |
-/*@-boundswrite@*/
|
|
Paul Nasrat |
7086a3 |
- *te++ = '\n';
|
|
Paul Nasrat |
7086a3 |
- *te = '\0';
|
|
Paul Nasrat |
7086a3 |
- rpmMessage(RPMMESS_NORMAL, "%s", t);
|
|
Paul Nasrat |
7086a3 |
- te = t;
|
|
Paul Nasrat |
7086a3 |
- *t = '\0';
|
|
Paul Nasrat |
7086a3 |
-/*@=boundswrite@*/
|
|
Paul Nasrat |
7086a3 |
- }
|
|
Paul Nasrat |
7086a3 |
-/*@=branchstate@*/
|
|
Paul Nasrat |
7086a3 |
+ flushBuffer(&t, &te, 0);
|
|
Paul Nasrat |
7086a3 |
}
|
|
Paul Nasrat |
7086a3 |
|
|
Paul Nasrat |
7086a3 |
rc = 0;
|
|
Paul Nasrat |
7086a3 |
|
|
Paul Nasrat |
7086a3 |
exit:
|
|
Paul Nasrat |
7086a3 |
- if (te > t) {
|
|
Paul Nasrat |
7086a3 |
- if (!nonewline) {
|
|
Paul Nasrat |
7086a3 |
-/*@-boundswrite@*/
|
|
Paul Nasrat |
7086a3 |
- *te++ = '\n';
|
|
Paul Nasrat |
7086a3 |
- *te = '\0';
|
|
Paul Nasrat |
7086a3 |
-/*@=boundswrite@*/
|
|
Paul Nasrat |
7086a3 |
- }
|
|
Paul Nasrat |
7086a3 |
- rpmMessage(RPMMESS_NORMAL, "%s", t);
|
|
Paul Nasrat |
7086a3 |
- }
|
|
Paul Nasrat |
7086a3 |
+ flushBuffer(&t, &te, 0);
|
|
Paul Nasrat |
7086a3 |
t = _free(t);
|
|
Paul Nasrat |
7086a3 |
|
|
Paul Nasrat |
7086a3 |
fi = rpmfiFree(fi);
|