{"thread":{"id":"17343","subject":"[PATCH v2] Makefile: Use libc strlcpy on OSX >= 10.2","startedAt":"2009-01-24T19:01:04Z","lastAt":"2009-01-24T20:23:33Z","messageCount":3,"participants":["Benjamin Kramer","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"101765","messageId":"7f978c810901241101h227c5437p88ca7c9cc54abc9a@mail.gmail.com","threadId":"17343","inReplyTo":null,"subject":"[PATCH v2] Makefile: Use libc strlcpy on OSX >= 10.2","fromName":"Benjamin Kramer","fromEmail":"benny.kra@googlemail.com","sentAt":"2009-01-24T19:01:04Z","receivedAt":"2009-01-24T19:01:04Z","isPatch":true,"sender":{"key":"benny.kra@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/16542?v=4"},"body":"OSX supports strlcpy(3) since 10.2 so we don't need\nto use our own. This revised also patch checks the darwin\nversion. 10.0 is darwin v1.3; 10.1 is darwin v1.4.\n\nSigned-off-by: Benjamin Kramer <benny.kra@gmail.com>\n---\n Makefile |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b4d9cb4..7dd5224 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -643,7 +643,9 @@ ifeq ($(uname_S),Darwin)\n \tifneq ($(shell expr \"$(uname_R)\" : '9\\.'),2)\n \t\tOLD_ICONV = UnfortunatelyYes\n \tendif\n-\tNO_STRLCPY = YesPlease\n+\tifeq ($(shell expr \"$(uname_R)\" : '1\\.'),2)\n+\t\tNO_STRLCPY = YesPlease\n+\tendif\n \tNO_MEMMEM = YesPlease\n \tTHREADED_DELTA_SEARCH = YesPlease\n endif\n-- \n1.6.1.285.g3454\n"},{"id":"101772","messageId":"7v8wp0o5il.fsf@gitster.siamese.dyndns.org","threadId":"17343","inReplyTo":"7f978c810901241101h227c5437p88ca7c9cc54abc9a@mail.gmail.com","subject":"Re: [PATCH v2] Makefile: Use libc strlcpy on OSX >= 10.2","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-24T19:42:10Z","receivedAt":"2009-01-24T19:42:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Benjamin Kramer <benny.kra@googlemail.com> writes:\n\n> OSX supports strlcpy(3) since 10.2 so we don't need\n> to use our own. This revised also patch checks the darwin\n> version. 10.0 is darwin v1.3; 10.1 is darwin v1.4.\n\nWhat does the output from \"uname -r\" and \"uname -s\" look like on your box\n(and older OSX boxes)?\n\n> @@ -643,7 +643,9 @@ ifeq ($(uname_S),Darwin)\n>  \tifneq ($(shell expr \"$(uname_R)\" : '9\\.'),2)\n>  \t\tOLD_ICONV = UnfortunatelyYes\n>  \tendif\n\nThis existing one says \"If 'uname -r' output does not begin with two\ncharacters '9.' (nine and dot), then set OLD_ICONV\".\n\n> -\tNO_STRLCPY = YesPlease\n> +\tifeq ($(shell expr \"$(uname_R)\" : '1\\.'),2)\n\nAnd this new one says \"If 'uname -r' output begins with two characters\n'1.' (one and dot), then set NO_STRLCPY\".\n\n> +\t\tNO_STRLCPY = YesPlease\n> +\tendif\n\nI am guessing that 'uname -r' says 9.X in \"Darwin 9.X\" (which is OSX\n10.5), and existing conditional says that versions before 9.X needs\nOLD_ICONV but later ones do not need it.\n\nDoes 1.X stand for OSX 10.2?  A quick googling finds a handful pages that\nsay that OSX 10.2 = Darwin 6.x and OSX 10.3 = Darwin 7.x, and I am not\nsure where you are getting that \"begins with one-and-dot\" from....\n\n>  \tNO_MEMMEM = YesPlease\n>  \tTHREADED_DELTA_SEARCH = YesPlease\n>  endif\n> -- \n> 1.6.1.285.g3454\n"},{"id":"101777","messageId":"7f978c810901241223n4f7c581av8a687a12b60367fe@mail.gmail.com","threadId":"17343","inReplyTo":"7v8wp0o5il.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH v2] Makefile: Use libc strlcpy on OSX >= 10.2","fromName":"Benjamin Kramer","fromEmail":"benny.kra@googlemail.com","sentAt":"2009-01-24T20:23:33Z","receivedAt":"2009-01-24T20:23:33Z","isPatch":true,"sender":{"key":"benny.kra@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/16542?v=4"},"body":"On Sat, Jan 24, 2009 at 20:42, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> This existing one says \"If 'uname -r' output does not begin with two\n> characters '9.' (nine and dot), then set OLD_ICONV\".\n>\n> I am guessing that 'uname -r' says 9.X in \"Darwin 9.X\" (which is OSX\n> 10.5), and existing conditional says that versions before 9.X needs\n> OLD_ICONV but later ones do not need it.\n\nYeah, that's because versions before 10.5 aka darwin 9 aka \"Leopard\" have a\nbroken iconv implementation.\n\n> Does 1.X stand for OSX 10.2?  A quick googling finds a handful pages that\n> say that OSX 10.2 = Darwin 6.x and OSX 10.3 = Darwin 7.x, and I am not\n> sure where you are getting that \"begins with one-and-dot\" from....\n\nI've got my information from [1]. It says:\n\ndarwin 1.3 => OSX 10.0\ndarwin 1.4 => OSX 10.1\ndarwin 6 => OSX 10.2\ndarwin 7 => OSX 10.3\netc.\n\nI don't know why they chose this weird versioning scheme, but wait, it gets\neven crazier\n\ndarwin 1.4.1 => OSX 10.1\ndarwin 5.1 => OSX 10.1.1\n\nSo my patch checks only for 10.1 but not for 10.1.1 *sigh*\n\n-     NO_STRLCPY = YesPlease\n+     ifeq ($(shell expr \"$(uname_R)\" : '[015]\\.'),2)\n+             NO_STRLCPY = YesPlease\n+     endif\n\nShould get all darwin versions before 6.0 in which strlcpy(3) was\nintroduced. Thanks for your patience ;)\n\n---------------\n[1] http://www.opensource.apple.com/darwinsource/\n"}]}