gnupic: gplink.c patch
Subject:
gplink.c patch
From:
Vangelis Rokas ####@####.####
Date:
19 Oct 2004 01:49:03 +0100
Message-Id: <Pine.LNX.4.61.0410190346310.9954@odyssey>
Anybody who compiles the latest CVS snapshot might encounter a segmentation
fault when running gplink.
You can apply the attached patch in the gplink/ directory to eliminate the
bug.
regards,
Vangelis
Index: gplink.c
===================================================================
RCS file: /cvsroot/gputils/gputils/gplink/gplink.c,v
retrieving revision 1.25
diff -c -p -c -p -r1.25 gplink.c
*** gplink.c 18 Oct 2004 00:59:25 -0000 1.25
--- gplink.c 19 Oct 2004 00:45:31 -0000
*************** process_args( int argc, char *argv[])
*** 533,546 ****
}
/* check if the first file is the linker script */
! pc = strrchr(argv[optind], '.');
! if (strcasecmp(pc, ".lkr") == 0) {
! if (state.srcfilename == NULL) {
! state.srcfilename = argv[optind++];
! } else {
! gp_error("linker script specified twice (%s and %s)",
! state.srcfilename,
! argv[optind]);
}
}
--- 533,548 ----
}
/* check if the first file is the linker script */
! if(argv[optind]) {
! pc = strrchr(argv[optind], '.');
! if (strcasecmp(pc, ".lkr") == 0) {
! if (state.srcfilename == NULL) {
! state.srcfilename = argv[optind++];
! } else {
! gp_error("linker script specified twice (%s and %s)",
! state.srcfilename,
! argv[optind]);
! }
}
}