From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Sixt Subject: Re: [PATCH v4 1/4] Refactor skipping DOS drive prefixes Date: Sat, 23 Jan 2016 20:02:12 +0100 Message-ID: <56A3CE34.20808@kdbg.org> References: <05cb9e00756e8a364f972cd227804764f6a6380c.1452585382.git.johannes.schindelin@gmx.de> <56A279DA.8080809@kdbg.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Junio C Hamano , git@vger.kernel.org, Ramsay Jones , Eric Sunshine To: Johannes Schindelin X-From: git-owner@vger.kernel.org Sat Jan 23 20:02:40 2016 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aN3SI-0001UU-Tt for gcvg-git-2@plane.gmane.org; Sat, 23 Jan 2016 20:02:39 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754044AbcAWTCe (ORCPT ); Sat, 23 Jan 2016 14:02:34 -0500 Received: from bsmtp8.bon.at ([213.33.87.20]:14496 "EHLO bsmtp8.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553AbcAWTCQ (ORCPT ); Sat, 23 Jan 2016 14:02:16 -0500 Received: from dx.site (unknown [93.83.142.38]) by bsmtp8.bon.at (Postfix) with ESMTPSA id 3pnmzT0WHhz5tlH; Sat, 23 Jan 2016 20:02:13 +0100 (CET) Received: from [IPv6:::1] (localhost [IPv6:::1]) by dx.site (Postfix) with ESMTP id 3D672513D; Sat, 23 Jan 2016 20:02:12 +0100 (CET) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Am 23.01.2016 um 09:25 schrieb Johannes Schindelin: > Hi Junio, > > On Fri, 22 Jan 2016, Junio C Hamano wrote: > >> Johannes Sixt writes: >> >>> I suggest to move the function definition out of line: >>> >>> diff --git a/compat/mingw.c b/compat/mingw.c >>> index 10a51c0..0cebb61 100644 >>> --- a/compat/mingw.c >>> +++ b/compat/mingw.c >>> @@ -1915,6 +1915,13 @@ pid_t waitpid(pid_t pid, int *status, int options) >>> return -1; >>> } >>> >>> +int mingw_skip_dos_drive_prefix(char **path) >>> +{ >>> + int ret = has_dos_drive_prefix(*path); >>> + *path += ret; >>> + return ret; >>> +} >>> + >>> int mingw_offset_1st_component(const char *path) >>> { >>> char *pos = (char *)path; >>> diff --git a/compat/mingw.h b/compat/mingw.h >>> index 9b5db4e..2099b79 100644 >>> --- a/compat/mingw.h >>> +++ b/compat/mingw.h >>> @@ -360,12 +360,7 @@ HANDLE winansi_get_osfhandle(int fd); >>> >>> #define has_dos_drive_prefix(path) \ >>> (isalpha(*(path)) && (path)[1] == ':' ? 2 : 0) >>> -static inline int mingw_skip_dos_drive_prefix(char **path) >>> -{ >>> - int ret = has_dos_drive_prefix(*path); >>> - *path += ret; >>> - return ret; >>> -} >>> +int mingw_skip_dos_drive_prefix(char **path); >>> #define skip_dos_drive_prefix mingw_skip_dos_drive_prefix >>> #define is_dir_sep(c) ((c) == '/' || (c) == '\\') >>> static inline char *mingw_find_last_dir_sep(const char *path) >> >> This sounds good to me. Dscho? > > Yep, sounds good to me, too. > > Personally, I have no inclination to add compatibility with the > now-safely-obsolete MSys to my responsibilities, but if Hannes wants to do > it, who am I to stand in his way? Especially when the fix is as trivial as > here. This is not a matter of compatibility. I am VERY curious why you do not see an error (or warning) without my proposed fixup. As I mentioned, isalpha() is defined much later than the definition of mingw_skip_dos_drive_prefix(). Where does your build get a declaration of isalpha() from? -- Hannes