From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: [PATCH] Add fraggenescan. Date: Sun, 27 Dec 2015 19:38:00 -0500 Message-ID: <20151228003800.GA14384@jasmine> References: <5676A0C1.4000004@uq.edu.au> <87egehl1ai.fsf@elephly.net> <56805DD7.8010900@uq.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDLp9-0008BC-0h for guix-devel@gnu.org; Sun, 27 Dec 2015 19:38:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aDLp5-0007eE-QI for guix-devel@gnu.org; Sun, 27 Dec 2015 19:38:06 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:39072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDLp5-0007e7-Jt for guix-devel@gnu.org; Sun, 27 Dec 2015 19:38:03 -0500 Content-Disposition: inline In-Reply-To: <56805DD7.8010900@uq.edu.au> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ben Woodcroft Cc: "guix-devel@gnu.org" On Mon, Dec 28, 2015 at 07:53:27AM +1000, Ben Woodcroft wrote: > On 20/12/15 23:03, Ricardo Wurmus wrote: [...] > >>+ (substitute* "run_hmm.c" > >>+ (("^ strcat\\(train_dir, \\\"train/\\\"\\);") > >>+ (string-append " strcpy(train_dir, \"" share "/train/\");"))) > >Why do you replace “strcat” with “strcpy” here? > The line above does a strcpy we don't want, so strcat would keep that. I > could remove the line above if you want, but this effectively makes no > difference to the running of the program. It looks like this substition has two parts: 1) Provide the correct path to some resources ("train files") for the program. 2) Change a function call from strcat() to strcpy(). Can you elaborate more on part 2? I undertand that the intended effect is to discard a value assigned to 'train_dir' [0] in the previous function call. This discarded value is 'argv[0]' minus 12 bytes [1]. The reason for this is that the program is looking for the "train files" in the same directory as 'argv[0]', but we have installed the "train files" somewhere else. Is that right? You mention in a comment in the patch that this program and other programs expect the "train files" to be in one place, but we are patching this line to account for the fact that we have installed them in another location. Will the other programs have to be patched as well? If so, do you think it would be better to let the files be installed in the unusual location chosen by upstream? [0] 'train_dir' is something like the --prefix parameter in a ./configure script. Many paths are generated based on it, and they all seem to be assigned to buffers with a length of 4096 bytes. [1] The magic number 12 is equal to the length of the basename of argv[0], "fraggenescan". For the benefit of those reading along...