Author: matt
Date: 2010-12-19 13:20:10 -0800 (Sun, 19 Dec 2010)
New Revision: 8063
Log:
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.
Modified:
branches/branch-1.3/FL/Fl_File_Chooser.H
branches/branch-1.3/FL/Fl_Help_Dialog.H
branches/branch-1.3/FL/Fl_Help_View.H
branches/branch-1.3/FL/filename.H
branches/branch-1.3/fluid/Fl_Function_Type.cxx
branches/branch-1.3/fluid/alignment_panel.fl
branches/branch-1.3/fluid/fluid.cxx
branches/branch-1.3/fluid/ide_support.h
branches/branch-1.3/fluid/template_panel.cxx
branches/branch-1.3/fluid/undo.cxx
branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
branches/branch-1.3/src/Fl_File_Browser.cxx
branches/branch-1.3/src/Fl_File_Chooser2.cxx
branches/branch-1.3/src/Fl_File_Icon2.cxx
branches/branch-1.3/src/Fl_File_Input.cxx
branches/branch-1.3/src/Fl_Help_View.cxx
branches/branch-1.3/src/filename_absolute.cxx
branches/branch-1.3/src/filename_isdir.cxx
branches/branch-1.3/src/filename_setext.cxx
branches/branch-1.3/src/fl_file_dir.cxx
branches/branch-1.3/src/fl_open_uri.cxx
branches/branch-1.3/src/forms_fselect.cxx
branches/branch-1.3/test/demo.cxx
branches/branch-1.3/test/editor.cxx
branches/branch-1.3/test/file_chooser.cxx
Modified: branches/branch-1.3/FL/Fl_File_Chooser.H
===================================================================
--- branches/branch-1.3/FL/Fl_File_Chooser.H 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/FL/Fl_File_Chooser.H 2010-12-19 21:20:10 UTC (rev
8063)
@@ -54,8 +54,8 @@
static Fl_Preferences prefs_;
void (*callback_)(Fl_File_Chooser*, void *);
void *data_;
- char directory_[1024];
- char pattern_[1024];
+ char directory_[FL_PATH_MAX];
+ char pattern_[FL_PATH_MAX];
char preview_text_[2048];
int type_;
void favoritesButtonCB();
Modified: branches/branch-1.3/FL/Fl_Help_Dialog.H
===================================================================
--- branches/branch-1.3/FL/Fl_Help_Dialog.H 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/FL/Fl_Help_Dialog.H 2010-12-19 21:20:10 UTC (rev
8063)
@@ -43,8 +43,8 @@
class FL_EXPORT Fl_Help_Dialog {
int index_;
int max_;
- int line_[100];
- char file_[100][256];
+ int line_[100]; // FIXME: we must remove those static numbers
+ char file_[100][FL_PATH_MAX]; // FIXME: we must remove those static numbers
int find_pos_;
public:
Fl_Help_Dialog();
Modified: branches/branch-1.3/FL/Fl_Help_View.H
===================================================================
--- branches/branch-1.3/FL/Fl_Help_View.H 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/FL/Fl_Help_View.H 2010-12-19 21:20:10 UTC (rev
8063)
@@ -42,6 +42,7 @@
# include "Fl_Scrollbar.H"
# include "fl_draw.H"
# include "Fl_Shared_Image.H"
+# include "filename.H"
//
@@ -235,8 +236,8 @@
atargets_; ///< Allocated targets
Fl_Help_Target *targets_; ///< Targets
- char directory_[1024]; ///< Directory for current file
- char filename_[1024]; ///< Current filename
+ char directory_[FL_PATH_MAX];///< Directory for current file
+ char filename_[FL_PATH_MAX]; ///< Current filename
int topline_, ///< Top line in document
leftline_, ///< Lefthand position
size_, ///< Total document length
Modified: branches/branch-1.3/FL/filename.H
===================================================================
--- branches/branch-1.3/FL/filename.H 2010-12-19 17:57:19 UTC (rev 8062)
+++ branches/branch-1.3/FL/filename.H 2010-12-19 21:20:10 UTC (rev 8063)
@@ -41,7 +41,7 @@
File names and URI functions defined in <FL/filename.H>
@{ */
-# define FL_PATH_MAX 256 /**< all path buffers should use this length */
+# define FL_PATH_MAX 2048 /**< all path buffers should use this length */
/** Gets the file name from a path.
Similar to basename(3), exceptions shown below.
\code
Modified: branches/branch-1.3/fluid/Fl_Function_Type.cxx
===================================================================
--- branches/branch-1.3/fluid/Fl_Function_Type.cxx 2010-12-19 17:57:19 UTC
(rev 8062)
+++ branches/branch-1.3/fluid/Fl_Function_Type.cxx 2010-12-19 21:20:10 UTC
(rev 8063)
@@ -1107,7 +1107,7 @@
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::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
Modified: branches/branch-1.3/fluid/alignment_panel.fl
===================================================================
--- branches/branch-1.3/fluid/alignment_panel.fl 2010-12-19 17:57:19 UTC
(rev 8062)
+++ branches/branch-1.3/fluid/alignment_panel.fl 2010-12-19 21:20:10 UTC
(rev 8063)
@@ -37,6 +37,9 @@
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 @@
xywh {0 0 100 20}
}
MenuItem {} {
- label {GNU gettext} selected
+ label {GNU gettext}
xywh {0 0 100 20}
}
MenuItem {} {
Modified: branches/branch-1.3/fluid/fluid.cxx
===================================================================
--- branches/branch-1.3/fluid/fluid.cxx 2010-12-19 17:57:19 UTC (rev 8062)
+++ branches/branch-1.3/fluid/fluid.cxx 2010-12-19 21:20:10 UTC (rev 8063)
@@ -105,8 +105,8 @@
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 @@
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_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 @@
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_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 @@
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 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 @@
// 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 @@
// 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 @@
// 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;
Modified: branches/branch-1.3/fluid/ide_support.h
===================================================================
--- branches/branch-1.3/fluid/ide_support.h 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/fluid/ide_support.h 2010-12-19 21:20:10 UTC (rev
8063)
@@ -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 @@
class Fl_File_Prefs : public Fl_Preferences {
- char pPath[1024];
+ char pPath[FL_PATH_MAX];
char pName[80];
char pFullName[100];
char pExt[20];
Modified: branches/branch-1.3/fluid/template_panel.cxx
===================================================================
--- branches/branch-1.3/fluid/template_panel.cxx 2010-12-19 17:57:19 UTC
(rev 8062)
+++ branches/branch-1.3/fluid/template_panel.cxx 2010-12-19 21:20:10 UTC
(rev 8063)
@@ -91,7 +91,7 @@
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 @@
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;
Modified: branches/branch-1.3/fluid/undo.cxx
===================================================================
--- branches/branch-1.3/fluid/undo.cxx 2010-12-19 17:57:19 UTC (rev 8062)
+++ branches/branch-1.3/fluid/undo.cxx 2010-12-19 21:20:10 UTC (rev 8063)
@@ -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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// Clear undo buffer
void undo_clear() {
- char filename[1024]; // Undo checkpoint filename
+ char filename[FL_PATH_MAX]; // Undo checkpoint filename
// Remove old checkpoint files...
Modified: branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
===================================================================
--- branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
2010-12-19 17:57:19 UTC (rev 8062)
+++ branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
2010-12-19 21:20:10 UTC (rev 8063)
@@ -8420,6 +8420,7 @@
isa = PBXProject;
buildConfigurationList = 615453DB5B8EBEE070930DA7 /*
Build configuration list for PBXProject "FLTK" */;
compatibilityVersion = "Xcode 3.0";
+ developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
Modified: branches/branch-1.3/src/Fl_File_Browser.cxx
===================================================================
--- branches/branch-1.3/src/Fl_File_Browser.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/src/Fl_File_Browser.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -536,7 +536,7 @@
// UNIX code uses /etc/fstab or similar...
//
FILE *mtab; // /etc/mtab or /etc/mnttab file
- char line[1024]; // Input line
+ char line[FL_PATH_MAX]; // Input line
//
// Open the file that contains a list of mounted filesystems...
Modified: branches/branch-1.3/src/Fl_File_Chooser2.cxx
===================================================================
--- branches/branch-1.3/src/Fl_File_Chooser2.cxx 2010-12-19 17:57:19 UTC
(rev 8062)
+++ branches/branch-1.3/src/Fl_File_Chooser2.cxx 2010-12-19 21:20:10 UTC
(rev 8063)
@@ -460,7 +460,7 @@
#ifdef WIN32
// See if the filename contains backslashes...
char *slash; // Pointer to slashes
- char fixpath[1024]; // Path with slashes converted
+ char fixpath[FL_PATH_MAX]; // Path with slashes converted
if (strchr(d, '\\')) {
// Convert backslashes to slashes...
strlcpy(fixpath, d, sizeof(fixpath));
@@ -524,8 +524,8 @@
Fl_File_Chooser::favoritesButtonCB()
{
int v; // Current selection
- char pathname[1024], // Pathname
- menuname[2048]; // Menu name
+ char pathname[FL_PATH_MAX], // Pathname
+ menuname[FL_PATH_MAX]; // Menu name
v = favoritesButton->value();
@@ -691,7 +691,7 @@
Fl_File_Chooser::fileListCB()
{
char *filename, // New filename
- pathname[1024]; // Full pathname to file
+ pathname[FL_PATH_MAX]; // Full pathname to file
filename = (char *)fileList->text(fileList->value());
@@ -792,8 +792,8 @@
{
char *filename, // New filename
*slash, // Pointer to trailing slash
- pathname[1024], // Full pathname to file
- matchname[256]; // Matching filename
+ pathname[FL_PATH_MAX], // Full pathname to file
+ matchname[FL_PATH_MAX]; // Matching filename
int i, // Looping var
min_match, // Minimum number of matching chars
max_match, // Maximum number of matching chars
@@ -890,7 +890,7 @@
directory(pathname);
if (filename[0]) {
- char tempname[1024];
+ char tempname[FL_PATH_MAX];
snprintf(tempname, sizeof(tempname), "%s/%s", directory_, filename);
fileName->value(tempname);
@@ -1001,7 +1001,7 @@
*start, // Start of pattern
*end; // End of pattern
int allfiles; // Do we have a "*" pattern?
- char temp[1024]; // Temporary pattern string
+ char temp[FL_PATH_MAX]; // Temporary pattern
string
// Make sure we have a pattern...
@@ -1048,7 +1048,7 @@
Fl_File_Chooser::newdir()
{
const char *dir; // New directory name
- char pathname[1024]; // Full path of directory
+ char pathname[FL_PATH_MAX]; // Full path of directory
// Get a directory name from the user
@@ -1129,7 +1129,7 @@
void
Fl_File_Chooser::rescan()
{
- char pathname[1024]; // New pathname for filename field
+ char pathname[FL_PATH_MAX]; // New pathname for filename field
// Clear the current filename
@@ -1167,7 +1167,7 @@
}
int i;
- char pathname[1024]; // New pathname for filename field
+ char pathname[FL_PATH_MAX]; // New pathname for filename field
strlcpy(pathname, fn, sizeof(pathname));
// Build the file list...
@@ -1213,7 +1213,7 @@
const char *item, // Selected item
*patstart; // Start of pattern
char *patend; // End of pattern
- char temp[1024]; // Temporary string for pattern
+ char temp[FL_PATH_MAX]; // Temporary string for pattern
item = showChoice->text(showChoice->value());
@@ -1250,7 +1250,7 @@
Fl_File_Chooser::update_favorites()
{
int i; // Looping var
- char pathname[1024], // Pathname
+ char pathname[FL_PATH_MAX], // Pathname
menuname[2048]; // Menu name
const char *home; // Home directory
@@ -1456,7 +1456,7 @@
int i; // Looping var
int fcount; // Number of selected files
const char *name; // Current filename
- static char pathname[1024]; // Filename + directory
+ static char pathname[FL_PATH_MAX]; // Filename + directory
name = fileName->value();
@@ -1503,7 +1503,7 @@
int i, // Looping var
fcount; // Number of items in list
char *slash; // Directory separator
- char pathname[1024]; // Local copy of filename
+ char pathname[FL_PATH_MAX]; // Local copy of filename
// printf("Fl_File_Chooser::value(\"%s\")\n", filename == NULL ? "(null)" :
filename);
@@ -1519,7 +1519,7 @@
#ifdef WIN32
// See if the filename contains backslashes...
- char fixpath[1024]; // Path with slashes converted
+ char fixpath[FL_PATH_MAX]; // Path with slashes converted
if (strchr(filename, '\\')) {
// Convert backslashes to slashes...
strlcpy(fixpath, filename, sizeof(fixpath));
Modified: branches/branch-1.3/src/Fl_File_Icon2.cxx
===================================================================
--- branches/branch-1.3/src/Fl_File_Icon2.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/src/Fl_File_Icon2.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -600,8 +600,8 @@
Fl_File_Icon::load_system_icons(void) {
int i; // Looping var
Fl_File_Icon *icon; // New icons
- char filename[1024]; // Filename
- char icondir[1024]; // Icon directory
+ char filename[FL_PATH_MAX]; // Filename
+ char icondir[FL_PATH_MAX]; // Icon directory
static int init = 0; // Have the icons been initialized?
const char * const icondirs[] = {
"Bluecurve", // Icon directories to look for, in order
@@ -811,7 +811,7 @@
int i; // Looping var
int n; // Number of entries in directory
dirent **entries; // Entries in directory
- char full[1024]; // Full name of file
+ char full[FL_PATH_MAX]; // Full name of file
entries = (dirent **)0;
@@ -841,11 +841,11 @@
const char *icondir) { // I - Location of icons
FILE *fp;
char tmp[1024];
- char iconfilename[1024];
+ char iconfilename[FL_PATH_MAX];
char pattern[1024];
char mimetype[1024];
char *val;
- char full_iconfilename[1024];
+ char full_iconfilename[FL_PATH_MAX];
Fl_File_Icon *icon;
Modified: branches/branch-1.3/src/Fl_File_Input.cxx
===================================================================
--- branches/branch-1.3/src/Fl_File_Input.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/src/Fl_File_Input.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -30,6 +30,7 @@
#include <FL/Fl_File_Input.H>
#include <FL/Fl_Window.H>
#include <FL/fl_draw.H>
+#include <FL/filename.H>
#include <stdio.h>
#include "flstring.h"
@@ -240,7 +241,7 @@
X; // Current X position
char *start, // Start of path component
*end; // End of path component
- char newvalue[1024]; // New value
+ char newvalue[FL_PATH_MAX]; // New value
// Figure out which button is being pressed...
Modified: branches/branch-1.3/src/Fl_Help_View.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Help_View.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/src/Fl_Help_View.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -2606,8 +2606,8 @@
Fl_Shared_Image *
Fl_Help_View::get_image(const char *name, int W, int H) {
const char *localname; // Local filename
- char dir[1024]; // Current directory
- char temp[1024], // Temporary filename
+ char dir[FL_PATH_MAX]; // Current directory
+ char temp[FL_PATH_MAX], // Temporary filename
*tempptr; // Pointer into temporary name
Fl_Shared_Image *ip; // Image pointer...
@@ -2703,8 +2703,8 @@
if (strcmp(linkp->filename, filename_) != 0 && linkp->filename[0])
{
- char dir[1024]; // Current directory
- char temp[1024], // Temporary filename
+ char dir[FL_PATH_MAX]; // Current directory
+ char temp[FL_PATH_MAX], // Temporary filename
*tempptr; // Pointer into temporary filename
@@ -3115,7 +3115,7 @@
char *slash; // Directory separator
const char *localname; // Local filename
char error[1024]; // Error buffer
- char newname[1024]; // New filename buffer
+ char newname[FL_PATH_MAX]; // New filename buffer
// printf("load(%s)\n",f); fflush(stdout);
@@ -3125,7 +3125,7 @@
strncmp(f, "ipp:", 4) == 0 ||
strncmp(f, "mailto:", 7) == 0 ||
strncmp(f, "news:", 5) == 0) {
- char urimsg[256];
+ char urimsg[FL_PATH_MAX];
if ( fl_open_uri(f, urimsg, sizeof(urimsg)) == 0 ) {
clear_selection();
Modified: branches/branch-1.3/src/filename_absolute.cxx
===================================================================
--- branches/branch-1.3/src/filename_absolute.cxx 2010-12-19 17:57:19 UTC
(rev 8062)
+++ branches/branch-1.3/src/filename_absolute.cxx 2010-12-19 21:20:10 UTC
(rev 8063)
@@ -121,7 +121,7 @@
[..]
chdir("/var/tmp/somedir"); // set cwd to /var/tmp/somedir
[..]
- char out[1024];
+ char out[FL_PATH_MAX];
fl_filename_relative(out, sizeof(out), "/var/tmp/somedir/foo.txt"); //
out="foo.txt", return=1
fl_filename_relative(out, sizeof(out), "/var/tmp/foo.txt"); //
out="../foo.txt", return=1
fl_filename_relative(out, sizeof(out), "foo.txt"); //
out="foo.txt", return=0 (no change)
@@ -139,7 +139,7 @@
const char *from) {// I - Absolute filename
char *newslash; // Directory separator
const char *slash; // Directory separator
- char cwd_buf[1024]; // Current directory
+ char cwd_buf[FL_PATH_MAX]; // Current directory
char *cwd = cwd_buf;
Modified: branches/branch-1.3/src/filename_isdir.cxx
===================================================================
--- branches/branch-1.3/src/filename_isdir.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/src/filename_isdir.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -60,7 +60,7 @@
*/
int fl_filename_isdir(const char* n) {
struct stat s;
- char fn[1024];
+ char fn[FL_PATH_MAX];
int length;
length = strlen(n);
Modified: branches/branch-1.3/src/filename_setext.cxx
===================================================================
--- branches/branch-1.3/src/filename_setext.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/src/filename_setext.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -40,7 +40,7 @@
\code
#include <FL/filename.H>
[..]
- char buf[1024] = "/path/myfile.cxx";
+ char buf[FL_PATH_MAX] = "/path/myfile.cxx";
fl_filename_setext(buf, sizeof(buf), ".txt"); // buf[] becomes
"/path/myfile.txt"
\endcode
Modified: branches/branch-1.3/src/fl_file_dir.cxx
===================================================================
--- branches/branch-1.3/src/fl_file_dir.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/src/fl_file_dir.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -80,7 +80,7 @@
const char *pat, // I - Filename pattern
const char *fname, // I - Initial filename selection
int relative) { // I - 0 for absolute path
- static char retname[1024]; // Returned filename
+ static char retname[FL_PATH_MAX]; // Returned filename
if (!fc) {
if (!fname || !*fname) fname = ".";
@@ -163,7 +163,7 @@
const char *fname, // I - Initial directory name
int relative) // I - 0 for absolute
{
- static char retname[1024]; // Returned directory name
+ static char retname[FL_PATH_MAX]; // Returned directory name
if (!fc) {
if (!fname || !*fname) fname = ".";
Modified: branches/branch-1.3/src/fl_open_uri.cxx
===================================================================
--- branches/branch-1.3/src/fl_open_uri.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/src/fl_open_uri.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -152,7 +152,7 @@
// BROWSER environment variables because we have no idea whether
// we need to run the listed commands in a terminal program.
- char command[1024], // Command to run...
+ char command[FL_PATH_MAX], // Command to run...
*argv[4], // Command-line arguments
remote[1024]; // Remote-mode command...
const char * const *commands; // Array of commands to check...
Modified: branches/branch-1.3/src/forms_fselect.cxx
===================================================================
--- branches/branch-1.3/src/forms_fselect.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/src/forms_fselect.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -30,9 +30,9 @@
#include <FL/forms.H>
#include "flstring.h"
-static char fl_directory[1024];
+static char fl_directory[FL_PATH_MAX];
static const char *fl_pattern; // assumed passed value is static
-static char fl_filename[1024];
+static char fl_filename[FL_PATH_MAX];
char* fl_show_file_selector(const char *message,const char *dir,
const char *pat,const char *fname) {
Modified: branches/branch-1.3/test/demo.cxx
===================================================================
--- branches/branch-1.3/test/demo.cxx 2010-12-19 17:57:19 UTC (rev 8062)
+++ branches/branch-1.3/test/demo.cxx 2010-12-19 21:20:10 UTC (rev 8063)
@@ -498,7 +498,7 @@
int main(int argc, char **argv) {
putenv((char *)"FLTK_DOCDIR=../documentation/html");
- char buf[256];
+ char buf[FL_PATH_MAX];
strcpy(buf, argv[0]);
#if ( defined _MSC_VER || defined __MWERKS__ ) && defined _DEBUG
// MS_VisualC appends a 'd' to debugging executables. remove it.
Modified: branches/branch-1.3/test/editor.cxx
===================================================================
--- branches/branch-1.3/test/editor.cxx 2010-12-19 17:57:19 UTC (rev 8062)
+++ branches/branch-1.3/test/editor.cxx 2010-12-19 21:20:10 UTC (rev 8063)
@@ -55,8 +55,8 @@
int changed = 0;
-char filename[256] = "";
-char title[256];
+char filename[FL_PATH_MAX] = "";
+char title[FL_PATH_MAX];
Fl_Text_Buffer *textbuf = 0;
Modified: branches/branch-1.3/test/file_chooser.cxx
===================================================================
--- branches/branch-1.3/test/file_chooser.cxx 2010-12-19 17:57:19 UTC (rev
8062)
+++ branches/branch-1.3/test/file_chooser.cxx 2010-12-19 21:20:10 UTC (rev
8063)
@@ -253,8 +253,8 @@
int) // I - Length of header data (unused)
{
const char *home; // Home directory
- char preview[1024], // Preview filename
- command[1024]; // Command
+ char preview[FL_PATH_MAX], // Preview filename
+ command[FL_PATH_MAX]; // Command
if (memcmp(header, "%PDF", 4) != 0)
@@ -284,9 +284,9 @@
int) // I - Length of header data (unused)
{
const char *home; // Home directory
- char preview[1024], // Preview filename
- outname[1024], // Preview PS file
- command[1024]; // Command
+ char preview[FL_PATH_MAX], // Preview filename
+ outname[FL_PATH_MAX], // Preview PS file
+ command[FL_PATH_MAX]; // Command
FILE *in, // Input file
*out; // Output file
int page; // Current page
@@ -346,7 +346,7 @@
{
int i; // Looping var
int count; // Number of files selected
- char relative[1024]; // Relative filename
+ char relative[FL_PATH_MAX]; // Relative filename
if (filter->value()[0])
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit