[haiku-commits] haiku: hrev50661 - src/apps/webpositive src/add-ons/kernel/partitioning_systems/gpt build/jam/packages

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 3 Nov 2016 14:38:38 +0100 (CET)

hrev50661 adds 3 changesets to branch 'master'
old head: c9275bf5173f1c0eaa0466f059831704cd908d2d
new head: fe8f306c499859d45006d3684b19ac133ece069f
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=fe8f306c4998+%5Ec9275bf5173f

----------------------------------------------------------------------------

34f42c6f3e67: BeDecorator: actually put it inside the package.

b7bc818b0eb5: style fix.

fe8f306c4998: WebPositive: fix search with URL-encoded pattern.
  
  The search URL for goodsearch is:
  http://www.goodsearch.com/search-web?utf8=%E2%9C%93&button=&keywords=%s
  
  It contains % characters (not too unusual for URLs with url-encoding).
  We can't give it to SetToFormat safely. Use ReplaceAll instead, so that
  only the %s is replaced.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

3 files changed, 9 insertions(+), 9 deletions(-)
build/jam/packages/Haiku                                | 5 ++---
src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp | 6 +++---
src/apps/webpositive/BrowserWindow.cpp                  | 7 ++++---

############################################################################

Commit:      34f42c6f3e673f4c42200fb3db35eb92fec94056
URL:         http://cgit.haiku-os.org/haiku/commit/?id=34f42c6f3e67
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Thu Nov  3 06:29:05 2016 UTC

BeDecorator: actually put it inside the package.

----------------------------------------------------------------------------

diff --git a/build/jam/packages/Haiku b/build/jam/packages/Haiku
index d7daef5..47617f7 100644
--- a/build/jam/packages/Haiku
+++ b/build/jam/packages/Haiku
@@ -266,9 +266,8 @@ AddFilesToPackage add-ons disk_systems
 AddFilesToPackage add-ons kernel bluetooth : $(SYSTEM_BT_STACK) ;
 
 # decorators
-AddFilesToHaikuImage system non-packaged add-ons decorators
-       : BeDecorator ;
-# MacDecorator WinDecorator
+AddFilesToPackage add-ons decorators : BeDecorator ;
+       # MacDecorator WinDecorator
 
 # the MIME DB
 CopyDirectoryToPackage data : <mimedb>mime_db : : : isTarget ;

############################################################################

Commit:      b7bc818b0eb5614cdc11b8eb1eab05abea462641
URL:         http://cgit.haiku-os.org/haiku/commit/?id=b7bc818b0eb5
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Thu Nov  3 06:38:10 2016 UTC

style fix.

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp 
b/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
index cbff2ef..0ba5d48 100644
--- a/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
+++ b/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
@@ -742,17 +742,17 @@ efi_gpt_uninitialize(int fd, partition_id partitionID, 
off_t partitionSize,
 
        update_disk_device_job_progress(job, 0.0);
 
-       const int header_size = partition->block_size * 3;
+       const int headerSize = partition->block_size * 3;
        // The first block is the protective MBR
        // The second block is the GPT header
        // The third block is the start of the partition list (it can span more
        // blocks, but that doesn't matter as soon as the header is erased).
 
-       uint8 buffer[header_size];
+       uint8 buffer[headerSize];
        memset(buffer, 0xE5, sizeof(buffer));
 
        // Erase the first blocks
-       if (write_pos(fd, 0, &buffer, header_size) < 0)
+       if (write_pos(fd, 0, &buffer, headerSize) < 0)
                return errno;
 
        // Erase the last blocks

############################################################################

Revision:    hrev50661
Commit:      fe8f306c499859d45006d3684b19ac133ece069f
URL:         http://cgit.haiku-os.org/haiku/commit/?id=fe8f306c4998
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Thu Nov  3 13:34:33 2016 UTC

WebPositive: fix search with URL-encoded pattern.

The search URL for goodsearch is:
http://www.goodsearch.com/search-web?utf8=%E2%9C%93&button=&keywords=%s

It contains % characters (not too unusual for URLs with url-encoding).
We can't give it to SetToFormat safely. Use ReplaceAll instead, so that
only the %s is replaced.

----------------------------------------------------------------------------

diff --git a/src/apps/webpositive/BrowserWindow.cpp 
b/src/apps/webpositive/BrowserWindow.cpp
index 175dfa8..f9d1271 100644
--- a/src/apps/webpositive/BrowserWindow.cpp
+++ b/src/apps/webpositive/BrowserWindow.cpp
@@ -2406,7 +2406,8 @@ BrowserWindow::_NewTabURL(bool isNewWindow) const
                        url = fStartPageURL;
                        break;
                case OpenSearchPage:
-                       url.SetToFormat(fSearchPageURL, "");
+                       url.SetTo(fSearchPageURL);
+                       url.ReplaceAll("%s", "");
                        break;
                case CloneCurrentPage:
                        if (CurrentWebView() != NULL)
@@ -2454,8 +2455,8 @@ BrowserWindow::_VisitURL(const BString& url)
 void
 BrowserWindow::_VisitSearchEngine(const BString& search)
 {
-       BString engine = "";
-       engine.SetToFormat(fSearchPageURL, 
_EncodeURIComponent(search).String());
+       BString engine(fSearchPageURL);
+       engine.ReplaceAll("%s", _EncodeURIComponent(search).String());
 
        _VisitURL(engine);
 }


Other related posts: