summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/browser.c3
-rw-r--r--desktop/options.c2
-rw-r--r--desktop/selection.c5
-rw-r--r--desktop/textinput.c8
4 files changed, 12 insertions, 6 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index 9f396c500..c00150ec7 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -2248,13 +2248,14 @@ void browser_window_scroll_box(struct browser_window *bw, struct box *box,
void browser_window_form_select(struct browser_window *bw,
struct form_control *control, int item)
{
+ struct box *inline_box;
struct form_option *o;
int count;
assert(bw);
assert(control);
- struct box *inline_box = control->box->children->children;
+ inline_box = control->box->children->children;
for (count = 0, o = control->data.select.items;
o != NULL;
diff --git a/desktop/options.c b/desktop/options.c
index e2ee7f231..8668afa74 100644
--- a/desktop/options.c
+++ b/desktop/options.c
@@ -44,6 +44,8 @@
#include "riscos/options.h"
#elif defined(nsgtk)
#include "gtk/options.h"
+#elif defined(nsbeos)
+#include "beos/options.h"
#else
#define EXTRA_OPTION_DEFINE
#define EXTRA_OPTION_TABLE
diff --git a/desktop/selection.c b/desktop/selection.c
index a66b12afd..2113f7d0c 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -548,6 +548,8 @@ bool selection_traverse(struct selection *s, seln_traverse_handler handler,
struct content *c;
save_text_whitespace before = WHITESPACE_NONE;
bool first = true;
+ const char *text;
+ size_t length;
if (!selection_defined(s))
return true; /* easy case, nothing to do */
@@ -560,8 +562,7 @@ bool selection_traverse(struct selection *s, seln_traverse_handler handler,
c = s->bw->current_content;
if (!c) return true;
- size_t length;
- const char *text = textplain_get_raw_data(c, s->start_idx,
+ text = textplain_get_raw_data(c, s->start_idx,
s->end_idx, &length);
if (text && !handler(text, length, NULL, handle, NULL, 0))
diff --git a/desktop/textinput.c b/desktop/textinput.c
index fa7ea443a..cb642132f 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -618,11 +618,12 @@ bool browser_window_textarea_callback(struct browser_window *bw,
case KEY_WORD_LEFT:
{
+ bool start_of_word;
/* if there is a selection, caret should stay at beginning */
if (selection_exists)
break;
- bool start_of_word = (char_offset <= 0 ||
+ start_of_word = (char_offset <= 0 ||
isspace(text_box->text[char_offset - 1]));
while (!word_left(text_box->text, &char_offset, NULL)) {
@@ -652,13 +653,14 @@ bool browser_window_textarea_callback(struct browser_window *bw,
case KEY_WORD_RIGHT:
{
+ bool in_word;
/* if there is a selection, caret should move to the end */
if (selection_exists) {
text_box = selection_get_end(bw->sel, &char_offset);
break;
}
- bool in_word = (char_offset < text_box->length &&
+ in_word = (char_offset < text_box->length &&
!isspace(text_box->text[char_offset]));
while (!word_right(text_box->text, text_box->length,
@@ -1822,13 +1824,13 @@ bool delete_handler(struct browser_window *bw, struct box *b,
void delete_selection(struct selection *s)
{
- assert(s->defined);
size_t start_offset, end_offset;
struct box *text_box = selection_get_start(s, &start_offset);
struct box *end_box = selection_get_end(s, &end_offset);
struct box *next;
size_t sel_len = s->end_idx - s->start_idx;
int beginning = 0;
+ assert(s->defined);
/* Clear selection so that deletion from textboxes proceeds */
selection_clear(s, true);