[haiku-commits] Re: haiku: hrev49418 - in src/apps/haikudepot: model ui

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 20 Jul 2015 07:06:42 +0000

+ if (value.Length()-1 == value.FindLast("/")) {
+ fprintf(stderr,"the url should be be terminated with a '/'\n");
+ return false;
+ }

That doesn't look right. Also, there is an BString::EndsWith() method.

There is a BUrl class which could do the whole URL parsing and normalization.
If there is a reason to not use it here, then the BUrl class should be
improved, rather than writing not easily reuseable code in each application.

--
Adrien.

Other related posts: