X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.6 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org X-Spam-Score: -0.6 To: Subject: Re: src/winsup/cygwin ChangeLog dcrt0.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 27 Jan 2012 11:46:46 +0100 From: =?UTF-8?Q?V=C3=A1clav_Zeman?= Message-ID: <25fbed8bb03f1d4ebf8de99b8be8bfbf@shell.sh.cvut.cz> X-Sender: v DOT haisman AT sh DOT cvut DOT cz User-Agent: Roundcube Webmail/0.7.1 X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 2012-01-27 10:28, corinna AT cygwin DOT com wrote: > CVSROOT: /cvs/src > Module name: src > Changes by: corinna AT sourceware DOT org 2012-01-27 09:28:38 > > Modified files: > winsup/cygwin : ChangeLog dcrt0.cc > > Log message: > * dcrt0.cc (is_dos_path): New macro to recognize drive letter and > UNC > DOS paths. > (globify): Call is_dos_path instead of isdrive. > > Patches: > > http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/ChangeLog.diff?cvsroot=src&r1=1.5666&r2=1.5667 > > http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/dcrt0.cc.diff?cvsroot=src&r1=1.422&r2=1.423 > --- src/winsup/cygwin/dcrt0.cc 2011/12/21 17:19:48 1.422 > +++ src/winsup/cygwin/dcrt0.cc 2012/01/27 09:28:38 1.423 > @@ -194,6 +194,14 @@ > /* Perform a glob on word if it contains wildcard characters. > Also quote every character between quotes to force glob to > treat the characters literally. */ > + > +/* Either X:[...] or \\server\[...] */ > +#define is_dos_path(s) (isdrive(s) \ > + || ((s)[0] == '\\' \ > + && (s)[1] == '\\' \ > + && isalpha ((s)[2]) \ > + && strchr ((s) + 3, '\\'))) Is it safe to access 2nd, 3rd and 4th characters of the word without checking the length first? Also, why a macro and not an inline function instead? -- VZ -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple