summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-07-31 11:12:27 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-07-31 11:12:27 +0300
commit0c737f72b244d7ecb4a5c8109f081d3e28c736aa (patch)
tree9ab1fb8dc83b962fd66c7b5e0b87c40d28658d65 /build
parent66ed9fc6160fb455a6c5760f426962e1288c19f8 (diff)
downloadlibrpm-tizen-0c737f72b244d7ecb4a5c8109f081d3e28c736aa.tar.gz
librpm-tizen-0c737f72b244d7ecb4a5c8109f081d3e28c736aa.tar.bz2
librpm-tizen-0c737f72b244d7ecb4a5c8109f081d3e28c736aa.zip
Track spec parse buffer position by offset instead of pointer
- Preliminaries for dynamically reallocating the buffer
Diffstat (limited to 'build')
-rw-r--r--build/parseSpec.c6
-rw-r--r--build/rpmbuild_internal.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 742059177..d2ee92235 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -160,12 +160,12 @@ static int copyNextLineFromOFI(rpmSpec spec, OFI_t *ofi)
if (!(spec->nextline && *spec->nextline)) {
int pc = 0, bc = 0, nc = 0;
char *from, *to, *p;
- to = spec->lbufPtr ? spec->lbufPtr : spec->lbuf;
+ to = spec->lbuf + spec->lbufOff;
from = ofi->readPtr;
ch = ' ';
while (from && *from && ch != '\n')
ch = *to++ = *from++;
- spec->lbufPtr = to;
+ spec->lbufOff = to - spec->lbuf;
*to = '\0';
ofi->readPtr = from;
@@ -199,7 +199,7 @@ static int copyNextLineFromOFI(rpmSpec spec, OFI_t *ofi)
spec->nextline = "";
return 1;
}
- spec->lbufPtr = spec->lbuf;
+ spec->lbufOff = 0;
/* Don't expand macros (eg. %define) in false branch of %if clause */
if (spec->readStack->reading &&
diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h
index 22a5d35c2..50ddbe3a9 100644
--- a/build/rpmbuild_internal.h
+++ b/build/rpmbuild_internal.h
@@ -42,7 +42,7 @@ struct rpmSpec_s {
struct OpenFileInfo * fileStack;
char lbuf[10*BUFSIZ];
- char *lbufPtr;
+ size_t lbufOff;
char nextpeekc;
char * nextline;
char * line;