Bug#298415: shx: FTBFS (amd64/gcc-4.0):
Package: shx
Severity: normal
Tags: patch
When building 'shx' on amd64 with gcc-4.0,
I get the following error:
hx_commands.c: In function 'expand_path':
hx_commands.c:2954: error: invalid lvalue in assignment
With the attached patch 'shx' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/shx-0.1.49/hx_commands.c ./hx_commands.c
--- ../tmp-orig/shx-0.1.49/hx_commands.c 2001-09-01 18:32:03.000000000 +0200
+++ ./hx_commands.c 2005-03-07 14:02:59.271076567 +0100
@@ -2951,7 +2951,7 @@
epchr = 0;
ambig = 0;
for (fh = cfl->fh; (u_int32_t)((char *)fh - (char *)cfl->fh) < cfl->fhlen;
- (char *)fh += flen + SIZEOF_HL_DATA_HDR) {
+ fh = (char *)fh + flen + SIZEOF_HL_DATA_HDR) {
L16NTOH(flen, &fh->len);
L32NTOH(fnlen, &fh->fnlen);
if (fnlen >= len && !strncmp(fh->fname, ent, len)) {
@@ -3030,7 +3030,7 @@
continue;
for (fh = cfl->fh; (u_int32_t)((char *)fh - (char *)cfl->fh) < cfl->fhlen;
- (char *)fh += flen + SIZEOF_HL_DATA_HDR) {
+ fh = (char *)fh + flen + SIZEOF_HL_DATA_HDR) {
L16NTOH(flen, &fh->len);
L32NTOH(fnlen, &fh->fnlen);
len = strlen(cfl->path) + 1 + fnlen + 1;
@@ -3113,7 +3113,7 @@
return 0;
for (fh = cfl->fh; (u_int32_t)((char *)fh - (char *)cfl->fh) < cfl->fhlen;
- (char *)fh += flen + SIZEOF_HL_DATA_HDR) {
+ fh = (char *)fh + flen + SIZEOF_HL_DATA_HDR) {
L16NTOH(flen, &fh->len);
L32NTOH(fnlen, &fh->fnlen);
if ((int)fnlen == len && !strncmp(fh->fname, ent, len))
diff -urN ../tmp-orig/shx-0.1.49/hx_tty.c ./hx_tty.c
--- ../tmp-orig/shx-0.1.49/hx_tty.c 2001-08-29 13:40:38.000000000 +0200
+++ ./hx_tty.c 2005-03-07 14:03:17.188618151 +0100
@@ -1080,7 +1080,7 @@
struct hl_filelist_hdr *fh;
for (fh = cfl->fh; (u_int32_t)((char *)fh - (char *)cfl->fh) < cfl->fhlen;
- (char *)fh += ntohs(fh->len) + SIZEOF_HL_DATA_HDR) {
+ fh = (char *)fh + ntohs(fh->len) + SIZEOF_HL_DATA_HDR) {
fnlen = ntohl(fh->fnlen);
for (i = 0, bpos = 0; i < fnlen && bpos < sizeof(buf); i++) {
if (!isgraph(fh->fname[i])) {
Reply to: