Skip to content

Commit

Permalink
haikudepot: Fix style issues in hrev49418
Browse files Browse the repository at this point in the history
  • Loading branch information
kallisti5 committed Jul 19, 2015
1 parent d52bb30 commit e34f263
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions src/apps/haikudepot/model/WebAppInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,27 +324,27 @@ static bool
arguments_is_url_valid(const BString& value)
{
if (value.Length() < 8) {
fprintf(stderr,"the url is less than 8 characters in length\n");
fprintf(stderr, "the url is less than 8 characters in length\n");
return false;
}

int32 schemeEnd = value.FindFirst("://");

if (schemeEnd == B_ERROR) {
fprintf(stderr,"the url does not contain the '://' string\n");
if (schemeEnd < B_OK) {
fprintf(stderr, "the url does not contain the '://' string\n");
return false;
}

BString scheme;
value.CopyInto(scheme, 0, schemeEnd);

if (scheme != "http" && scheme != "https") {
fprintf(stderr,"the url scheme should be 'http' or 'https'\n");
fprintf(stderr, "the url scheme should be 'http' or 'https'\n");
return false;
}

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

Expand All @@ -356,9 +356,9 @@ arguments_is_url_valid(const BString& value)
indicate if the URL was acceptable.
\return B_OK if the base URL was valid and B_BAD_VALUE if not.
*/

status_t
WebAppInterface::SetBaseUrl(const BString& url) {
WebAppInterface::SetBaseUrl(const BString& url)
{
if (!arguments_is_url_valid(url))
return B_BAD_VALUE;

Expand Down Expand Up @@ -691,7 +691,7 @@ BString
WebAppInterface::_FormFullUrl(const BString& suffix) const
{
if (fBaseUrl.IsEmpty()) {
fprintf(stderr,"illegal state - missing web app base url\n");
fprintf(stderr, "illegal state - missing web app base url\n");
exit(EXIT_FAILURE);
}

Expand Down
10 changes: 5 additions & 5 deletions src/apps/haikudepot/ui/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,22 @@ App::ArgvReceived(int32 argc, char* argv[])
for (int i = 1; i < argc;) {
if (0 == strcmp("--webappbaseurl", argv[i])) {
if (i == argc-1) {
fprintf(stderr,"unexpected end of arguments; missing web app base url\n");
fprintf(stderr, "unexpected end of arguments; missing web app base url\n");
Quit();
}

if (B_OK != WebAppInterface::SetBaseUrl(argv[i+1])) {
fprintf(stderr,"malformed web app base url; %s\n", argv[i+1]);
if (WebAppInterface::SetBaseUrl(argv[i + 1]) != B_OK) {
fprintf(stderr, "malformed web app base url; %s\n", argv[i + 1]);
Quit();
}
else
fprintf(stderr,"did configure the web base url; %s\n",argv[i+1]);
fprintf(stderr, "did configure the web base url; %s\n",argv[i + 1]);

i += 2;
} else {
BEntry entry(argv[i], true);
_Open(entry);
i ++;
i++;
}
}
}
Expand Down

0 comments on commit e34f263

Please sign in to comment.