diff options
author | Robert Kukla <roolku@rockbox.org> | 2007-08-13 13:53:33 +0000 |
---|---|---|
committer | Robert Kukla <roolku@rockbox.org> | 2007-08-13 13:53:33 +0000 |
commit | 2ae0d63c886a20f479296f16ed86bda40b6b6945 (patch) | |
tree | ff3198a0526ac28f070279671a78a30e6e467bad /apps | |
parent | 41a57765395585733a2a1faa9032606bc00fd8a0 (diff) |
corrected logic in expression of jdgordon's r14187 commit; should fix FS#7590. Tidied up exit paths while I was at it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14313 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/viewer.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index 897b7c827e..3fb0856db1 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c @@ -377,7 +377,7 @@ static unsigned char* find_last_space(const unsigned char* p, int size) for (i=size-1; i>=0; i--) for (j=k; j < (int) sizeof(line_break); j++) { - if (((p[i] != '-') && (prefs.word_mode != WRAP))) + if (!((p[i] == '-') && (prefs.word_mode == WRAP))) if (p[i] == line_break[j]) return (unsigned char*) p+i; } @@ -1128,6 +1128,9 @@ static void viewer_load_settings(void) /* same name as global, but not the same static void viewer_save_settings(void)/* same name as global, but not the same file.. */ { int settings_fd; + + rb->splash(1, "Saving Settings"); + settings_fd = rb->creat(SETTINGS_FILE); /* create the settings file */ rb->write (settings_fd, &prefs, sizeof(struct preferences)); @@ -1320,7 +1323,6 @@ static void viewer_menu(void) switch (result) { case 0: /* quit */ - rb->splash(1, "Saving Settings"); menu_exit(m); viewer_exit(NULL); done = true; @@ -1357,9 +1359,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) file_name = file; ok = viewer_init(); if (!ok) { - rb->splash(HZ, "Error"); - viewer_exit(NULL); - return PLUGIN_OK; + rb->splash(HZ, "Error opening file."); + return PLUGIN_ERROR; } viewer_reset_settings(); /* load defaults first */ |