Re: [PATCH 12/22] delete_ref_loose(): don't muck around in the lock_file's filename
- From
Jeff King <peff@peff.net>
- Date
- Apr 2, 2014, 06:55 UTC
- Message-ID
- <20140402065558.GA2395@sigill.intra.peff.net>
- In-Reply-To
- <533BB3A1.1080203@web.de>
On Wed, Apr 02, 2014 at 08:52:17AM +0200, Torsten Bögershausen wrote:
Show 13 quoted lines
> + /* > + * loose. The loose file name is the same as the > + * lockfile name, minus ".lock": > + */ > + char *loose_filename = xmemdupz(lock->lk->filename, > + strlen(lock->lk->filename) - 5); > > At other places (lockfile.c) we use this > > +#define LOCK_SUFFIX_LEN 5 > > I think it makes sense to move this definition to an include file (lockfile.h ??) > and use it here.
I had the same comment, but if you read through to patch 18, this manual munging goes away entirely, and the end result is much cleaner.
-Peff