diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2010-12-19 21:20:10 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2010-12-19 21:20:10 +0000 |
| commit | 9092dccab89901b7074f9340bc7984910a80128f (patch) | |
| tree | 9c8d6ca2efa5c968060dc8b83afcec7daedfe764 /fluid | |
| parent | dc0c85b9644553ac9b5c51da43697b9906f9b44d (diff) | |
Changed all fixed filename buffers (that I could find) to use FL_PATH_MX instead. Raised FL_PATH_MX from skipy 256 characters to 2048, which corresponds with modern file systems.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8063 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid')
| -rw-r--r-- | fluid/Fl_Function_Type.cxx | 4 | ||||
| -rw-r--r-- | fluid/alignment_panel.fl | 5 | ||||
| -rw-r--r-- | fluid/fluid.cxx | 32 | ||||
| -rw-r--r-- | fluid/ide_support.h | 3 | ||||
| -rw-r--r-- | fluid/template_panel.cxx | 4 | ||||
| -rw-r--r-- | fluid/undo.cxx | 11 |
6 files changed, 32 insertions, 27 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index d7c0774fc..a015190a4 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -1107,7 +1107,7 @@ void Fl_Comment_Type::open() { comment_in_header->value(in_h_); comment_panel->show(); const char* message = 0; - char itempath[256]; itempath[0] = 0; + char itempath[FL_PATH_MAX]; itempath[0] = 0; int last_selected_item = 0; for (;;) { // repeat as long as there are errors if (message) fl_alert("%s", message); @@ -1350,7 +1350,7 @@ void Fl_Class_Type::read_property(const char *c) { void Fl_Class_Type::open() { if (!class_panel) make_class_panel(); - char fullname[1024]=""; + char fullname[FL_PATH_MAX]=""; if (prefix() && strlen(prefix())) sprintf(fullname,"%s %s",prefix(),name()); else diff --git a/fluid/alignment_panel.fl b/fluid/alignment_panel.fl index 4cbc79440..3ae4bcf35 100644 --- a/fluid/alignment_panel.fl +++ b/fluid/alignment_panel.fl @@ -37,6 +37,9 @@ decl {\#include <FL/Fl_Text_Buffer.H>} {public local decl {\#include <FL/Fl_Text_Display.H>} {public local } +decl {\#include <FL/filename.H>} {selected public local +} + decl {extern void load_history();} {public local } @@ -119,7 +122,7 @@ Function {make_project_window()} {open xywh {0 0 100 20} } MenuItem {} { - label {GNU gettext} selected + label {GNU gettext} xywh {0 0 100 20} } MenuItem {} { diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 532a03d0e..49408b87a 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -105,8 +105,8 @@ int show_comments = 1; int show_coredevmenus = 1; // File history info... -char absolute_history[10][1024]; -char relative_history[10][1024]; +char absolute_history[10][FL_PATH_MAX]; +char relative_history[10][FL_PATH_MAX]; void load_history(); void update_history(const char *); @@ -133,11 +133,11 @@ void goto_source_dir() { if (!filename || !*filename) return; const char *p = fl_filename_name(filename); if (p <= filename) return; // it is in the current directory - char buffer[1024]; + char buffer[FL_PATH_MAX]; strlcpy(buffer, filename, sizeof(buffer)); int n = p-filename; if (n>1) n--; buffer[n] = 0; if (!pwd) { - pwd = getcwd(0,1024); + pwd = getcwd(0,FL_PATH_MAX); if (!pwd) {fprintf(stderr,"getwd : %s\n",strerror(errno)); return;} } if (chdir(buffer)<0) {fprintf(stderr, "Can't chdir to %s : %s\n", @@ -182,7 +182,7 @@ Fl_Window *main_window; Fl_Menu_Bar *main_menubar; static char* cutfname(int which = 0) { - static char name[2][1024]; + static char name[2][FL_PATH_MAX]; static char beenhere = 0; if (!beenhere) { @@ -263,14 +263,14 @@ void save_template_cb(Fl_Widget *, void *) { if (!c || !*c) return; // Convert template name to filename_with_underscores - char safename[1024], *safeptr; + char safename[FL_PATH_MAX], *safeptr; strlcpy(safename, c, sizeof(safename)); for (safeptr = safename; *safeptr; safeptr ++) { if (isspace(*safeptr)) *safeptr = '_'; } // Find the templates directory... - char filename[1024]; + char filename[FL_PATH_MAX]; fluid_prefs.getUserdataPath(filename, sizeof(filename)); strlcat(filename, "templates", sizeof(filename)); @@ -653,15 +653,15 @@ const char* i18n_include = ""; const char* i18n_function = ""; const char* i18n_file = ""; const char* i18n_set = ""; -char i18n_program[1024] = ""; +char i18n_program[FL_PATH_MAX] = ""; void write_cb(Fl_Widget *, void *) { if (!filename) { save_cb(0,0); if (!filename) return; } - char cname[1024]; - char hname[1024]; + char cname[FL_PATH_MAX]; + char hname[FL_PATH_MAX]; strlcpy(i18n_program, fl_filename_name(filename), sizeof(i18n_program)); fl_filename_setext(i18n_program, sizeof(i18n_program), ""); if (*code_file_name == '.' && strchr(code_file_name, '/') == NULL) { @@ -698,7 +698,7 @@ void write_strings_cb(Fl_Widget *, void *) { save_cb(0,0); if (!filename) return; } - char sname[1024]; + char sname[FL_PATH_MAX]; strlcpy(sname, fl_filename_name(filename), sizeof(sname)); fl_filename_setext(sname, sizeof(sname), exts[i18n_type]); if (!compile_only) goto_source_dir(); @@ -848,14 +848,14 @@ void about_cb(Fl_Widget *, void *) { void show_help(const char *name) { const char *docdir; - char helpname[1024]; + char helpname[FL_PATH_MAX]; if (!help_dialog) help_dialog = new Fl_Help_Dialog(); if ((docdir = getenv("FLTK_DOCDIR")) == NULL) { #ifdef __EMX__ // Doesn't make sense to have a hardcoded fallback - static char fltk_docdir[1024]; + static char fltk_docdir[FL_PATH_MAX]; strlcpy(fltk_docdir, __XOS2RedirRoot("/XFree86/lib/X11/fltk/doc"), sizeof(fltk_docdir)); @@ -1152,7 +1152,7 @@ void print_menu_cb(Fl_Widget *, void *) { // Quote a string for PostScript printing static const char *ps_string(const char *s) { char *bufptr; - static char buffer[2048]; + static char buffer[FL_PATH_MAX]; if (!s) { @@ -1853,7 +1853,7 @@ void load_history() { // Update file history from preferences... void update_history(const char *flname) { int i; // Looping var - char absolute[1024]; + char absolute[FL_PATH_MAX]; int max_files; @@ -2241,7 +2241,7 @@ void update_sourceview_timer(void*) // Set the "modified" flag and update the title of the main window... void set_modflag(int mf) { const char *basename; - static char title[1024]; + static char title[FL_PATH_MAX]; modflag = mf; diff --git a/fluid/ide_support.h b/fluid/ide_support.h index 794f04f09..2aef035ec 100644 --- a/fluid/ide_support.h +++ b/fluid/ide_support.h @@ -30,6 +30,7 @@ #include <FL/Fl.H> #include <FL/Fl_Preferences.H> +#include <FL/filename.H> typedef char Fl_UUID[40]; @@ -81,7 +82,7 @@ public: class Fl_File_Prefs : public Fl_Preferences { - char pPath[1024]; + char pPath[FL_PATH_MAX]; char pName[80]; char pFullName[100]; char pExt[20]; diff --git a/fluid/template_panel.cxx b/fluid/template_panel.cxx index 07d98caab..1feb81a10 100644 --- a/fluid/template_panel.cxx +++ b/fluid/template_panel.cxx @@ -91,7 +91,7 @@ template_name->value(template_browser->text(item)); template_delete->activate(); -char pngfile[1024], *ext; +char pngfile[FL_PATH_MAX], *ext; strlcpy(pngfile, flfile, sizeof(pngfile)); if ((ext = strrchr(pngfile, '.')) == NULL) return; @@ -222,7 +222,7 @@ template_browser->do_callback(); void template_load() { int i; -char name[1024], filename[1024], path[1024], *ptr; +char name[FL_PATH_MAX], filename[FL_PATH_MAX], path[FL_PATH_MAX], *ptr; struct dirent **files; int num_files; diff --git a/fluid/undo.cxx b/fluid/undo.cxx index 8d982a43c..0df6662a5 100644 --- a/fluid/undo.cxx +++ b/fluid/undo.cxx @@ -29,6 +29,7 @@ #include "Fl_Type.h" #include "undo.h" #include <FL/Fl_Preferences.H> +#include <FL/filename.H> #include "../src/flstring.h" #if defined(WIN32) && !defined(__CYGWIN__) # include <io.h> @@ -68,7 +69,7 @@ static int undo_paused = 0; // Undo checkpointing paused? // Return the undo filename static char *undo_filename(int level, char *buf, int bufsize) { - static char undo_path[1024] = ""; // Undo path + static char undo_path[FL_PATH_MAX] = ""; // Undo path if (!undo_path[0]) fluid_prefs.getUserdataPath(undo_path, sizeof(undo_path)); @@ -80,7 +81,7 @@ static char *undo_filename(int level, char *buf, int bufsize) { // Redo menu callback void redo_cb(Fl_Widget *, void *) { - char filename[1024]; // Undo checkpoint file + char filename[FL_PATH_MAX]; // Undo checkpoint file if (undo_current >= undo_last) return; @@ -103,7 +104,7 @@ void redo_cb(Fl_Widget *, void *) { // Undo menu callback void undo_cb(Fl_Widget *, void *) { - char filename[1024]; // Undo checkpoint file + char filename[FL_PATH_MAX]; // Undo checkpoint file if (undo_current <= 0) return; @@ -131,7 +132,7 @@ void undo_cb(Fl_Widget *, void *) { // Save current file to undo buffer void undo_checkpoint() { - char filename[1024]; // Undo checkpoint filename + char filename[FL_PATH_MAX]; // Undo checkpoint filename // printf("undo_checkpoint(): undo_current=%d, undo_paused=%d, modflag=%d\n", // undo_current, undo_paused, modflag); @@ -162,7 +163,7 @@ void undo_checkpoint() { // Clear undo buffer void undo_clear() { - char filename[1024]; // Undo checkpoint filename + char filename[FL_PATH_MAX]; // Undo checkpoint filename // Remove old checkpoint files... |
