From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Fri, 02 Mar 2012 08:16:10 +0100 Subject: [U-Boot] [PATCH] Avoid using GNU basename In-Reply-To: References: Message-ID: <20120302071610.820A8185B4B9@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Keith Mok, In message you wrote: > There is no GNU basename support in MacOS. > Use generic POSIX basename defined in libgen.h instead. ... > int fp, ep; > const char *prg; > + char *prog_pathname; > > - prg = basename(argv[0]); > + prog_pathname = strdup(argv[0]); > + prg = basename(prog_pathname); free() missing. Actually the strdup should not be needed at all, as we don't use argv[0] after that - at least we shouldn't. The remaining "usage(argv[0]);" should be fixed instead. Besides - I agree with Mike's comment how your MacOS issue should be fixed. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Drun'? 'm not drun'! You woudn' dare call m' drun' if I was sober! - Terry Pratchett, _Men at Arms_