From: Alex Riesen Date: Thu, 14 May 2009 05:54:34 GMT Subject: Re: [PATCH 2/2] Improve the naming of guessed target repository for git clone Message-ID: <81b0412b0905132254n5046666t24f3887f1fd4e4d9@mail.gmail.com> In-Reply-To: <7vfxf81ppd.fsf@alter.siamese.dyndns.org> 2009/5/14 Junio C Hamano : > Alex Riesen writes: >> +     /* replace all 'control' characters with ascii space */ >> +     for (start = dir; *start; ++start) >> +             if (*(const unsigned char *)start < 32u) >> +                     dir[start - dir] = '\x20'; > > What's this strange mixture of 32u and '\x20'? > Not sure myself. I probably wanted visibility, and somehow ended up using different presentations. >> +     /* remove trailing spaces */ >> +     if (dir < start) >> +             for (end = start; dir < --end; ) >> +                     if (!isspace(*end)) >> +                             break; >> +                     else >> +                             dir[end - dir] = '\0'; >> +     return dir; >>  } > > Honestly, I regret having asked if there was a 2/2 ;-) > > What's the point of this change, now that you have a fix in 1/2?  Who are > you helping with this patch? > Without this the _automatically_ generated names for cloned repositories have all the whitespace around them. As you cannot sanely depend on automatically generated names, I thought that making them simpler will make sense. But I should complete the patch: remove heading whitespace, and replace multiple spaces and control characters with one space.