[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minor feature additions
[Thread Prev] | [Thread Next]
- Subject: Re: Minor feature additions
- From: Norbert Kiesel <nkiesel@xxxxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Tue, 14 Jul 2009 08:54:44 -0700
- To: libssh@xxxxxxxxxx
On Sun, 2009-07-12 at 23:08 +0200, Aris Adamantiadis wrote: > I have implemented the change as we discussed, by a regular expression > matching in the connect code. look commit > 052073c36d33089d3a99992840c88c6245461813. Why not use the "standard" regexp for IPV4 addresses? </nk>
diff --git a/libssh/connect.c b/libssh/connect.c index 91ec029..c82488b 100644 --- a/libssh/connect.c +++ b/libssh/connect.c @@ -108,7 +108,7 @@ int ssh_regex_init(){ int err; regex_t *regex=malloc(sizeof (regex_t)); ZERO_STRUCTP(regex); - err=regcomp(regex,"^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$",REG_EXTENDED | REG_NOSUB); + err=regcomp(regex,"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",REG_EXTENDED | REG_NOSUB); if(err != 0){ char buffer[128]; regerror(err,regex,buffer,sizeof(buffer));
Minor feature additions | Chris Backas <chb@xxxxxxxxxxxxxxxxxx> |
Re: Minor feature additions | Andreas Schneider <mail@xxxxxxxxxxxx> |
Re: Minor feature additions | Aris Adamantiadis <aris@xxxxxxxxxxxx> |
Re: Minor feature additions | Chris Backas <chb@xxxxxxxxxxxxxxxxxx> |
Re: Minor feature additions | Aris Adamantiadis <aris@xxxxxxxxxxxx> |