mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* edit-widget.h (editor_widget): Rename stat' to
stat1' to
avoid problems on Solaris with 64-bit file access, when `stat' is a macro. All users adjusted. Reported by Maksym Polyakov <polyama@yahoo.com>.
This commit is contained in:
parent
44700b7f69
commit
3ec7c60591
@ -1,3 +1,10 @@
|
||||
2001-06-26 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* edit-widget.h (editor_widget): Rename `stat' to `stat1' to
|
||||
avoid problems on Solaris with 64-bit file access, when `stat'
|
||||
is a macro. All users adjusted.
|
||||
Reported by Maksym Polyakov <polyama@yahoo.com>.
|
||||
|
||||
2001-06-25 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* gtkedit.c: Remove home_dir - it's declared in main.c.
|
||||
|
@ -113,7 +113,7 @@ struct editor_widget {
|
||||
unsigned long stack_size;
|
||||
unsigned long stack_size_mask;
|
||||
unsigned long stack_bottom;
|
||||
struct stat stat;
|
||||
struct stat stat1;
|
||||
|
||||
/* syntax higlighting */
|
||||
struct _syntax_marker *syntax_marker;
|
||||
|
@ -427,7 +427,7 @@ int edit_open_file (WEdit * edit, const char *filename, const char *text, unsign
|
||||
#endif
|
||||
if (r)
|
||||
return 1;
|
||||
edit->stat = st;
|
||||
edit->stat1 = st;
|
||||
#ifndef CR_LF_TRANSLATION
|
||||
edit->last_byte = st.st_size;
|
||||
#else
|
||||
@ -502,9 +502,9 @@ WEdit *edit_init (WEdit * edit, int lines, int columns, const char *filename, co
|
||||
#endif
|
||||
edit->num_widget_lines = lines;
|
||||
edit->num_widget_columns = columns;
|
||||
edit->stat.st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
|
||||
edit->stat.st_uid = getuid ();
|
||||
edit->stat.st_gid = getgid ();
|
||||
edit->stat1.st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
|
||||
edit->stat1.st_uid = getuid ();
|
||||
edit->stat1.st_gid = getgid ();
|
||||
edit->bracket = -1;
|
||||
if (!dir)
|
||||
dir = "";
|
||||
@ -559,7 +559,7 @@ WEdit *edit_init (WEdit * edit, int lines, int columns, const char *filename, co
|
||||
free (edit);
|
||||
return 0;
|
||||
}
|
||||
edit->stat = st;
|
||||
edit->stat1 = st;
|
||||
if (!edit_insert_file (edit, f)) {
|
||||
edit_clean (edit);
|
||||
if (to_free)
|
||||
|
@ -285,11 +285,12 @@ int edit_save_file (WEdit * edit, const char *filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((fd = open (savename, O_CREAT | O_WRONLY | O_TRUNC | MY_O_TEXT, edit->stat.st_mode)) == -1)
|
||||
if ((fd = open (savename, O_CREAT | O_WRONLY | O_TRUNC | MY_O_TEXT,
|
||||
edit->stat1.st_mode)) == -1)
|
||||
goto error_save;
|
||||
|
||||
chmod (savename, edit->stat.st_mode);
|
||||
chown (savename, edit->stat.st_uid, edit->stat.st_gid);
|
||||
chmod (savename, edit->stat1.st_mode);
|
||||
chown (savename, edit->stat1.st_uid, edit->stat1.st_gid);
|
||||
|
||||
/* pipe save */
|
||||
if ((p = (char *) edit_get_write_filter (savename, filename))) {
|
||||
|
Loading…
Reference in New Issue
Block a user