Pavel Roskin
926d54ad68
* util.c (load_file_position): Don't free filename.
2002-12-09 16:42:20 +00:00
Pavel Roskin
c077626450
(load_file_position): don't free filename.
2002-12-08 07:02:48 +00:00
Pavel Roskin
65f23dcb15
* util.c: Add functions for saving and loading file positions.
2002-12-08 06:51:22 +00:00
Andrew V. Samoilov
74b5eb3ac7
* view.c (get_line_at): Use g_strreverse() instead of
...
reverse_string().
* util.c (reverse_string): Remove.
(decompress_extension): Return const char *.
(strip_home_and_password): Make dir const.
* util.c (reverse_string): Fix declarations.
2002-11-12 11:20:08 +00:00
Pavel Roskin
db31e4b3c4
* main.c (main): Use O_TRUNC when opening the file to write the
...
last working directory. Fix segmentation fault when exiting
while on VFS.
* util.c (mc_mkstemps): Use O_TRUNC to open temporary files.
2002-11-01 20:24:07 +00:00
Pavel Roskin
4cf69ff615
* util.c (name_trunc): Remove unused code, unhelpful error
...
message and workaround for bugs in the callers.
2002-09-27 21:20:41 +00:00
Pavel Roskin
da7e82d253
Global removal of RCS Id: flags.
2002-09-26 23:13:45 +00:00
Andrew V. Samoilov
758842a16d
* util.c (mc_mkstemps): Really return NULL in the filename in the
...
case of failure. Reported by Andrew W. Nosenko <awn@bcs.zp.ua>.
2002-09-26 22:13:16 +00:00
Pavel Roskin
c785d4195b
* global.h: Move fcntl.h inclusion here. Define O_BINARY.
...
* mountlist.c: Remove more includes already handled in global.h.
2002-09-23 06:43:22 +00:00
Pavel Roskin
bbf6cdb792
* util.c (is_printable): Disable "Full 8 bits output" on xterm,
...
fall back to "ISO 8859-1" due to problems with gnome-terminal,
which identifies itself as xterm.
Reported by Miven Dooligan <dooligan@intergate.ca>
2002-09-22 07:40:56 +00:00
Pavel Roskin
485b40ac2a
* utilunix.c (mc_tmpdir): New function that returns temporary
...
directory for mc.
* util.c (mc_mkstemps): Use mc_tmpdir().
* main.c (main): Call mc_tmpdir().
2002-09-11 04:58:24 +00:00
Pavel Roskin
8568fc50d9
* Make-alone.am: Get rid of all standalone code, it has been
...
unmaintained for years.
2002-09-10 21:48:49 +00:00
Pavel Roskin
08440f7e8d
* util.c (trim): Handle short strings even better - don't use
...
dots unless necessary.
2002-09-10 21:39:07 +00:00
Pavel Roskin
1314fc2a07
* screen.c (show_dir): Don't call trim() with negative length.
...
* util.c (trim): Better handle short length. Make sure that the
destination is always 0-terminated.
2002-09-10 19:58:33 +00:00
Pavel Roskin
ca90bd204f
* fs.h: Only redefine S_IS* macros if they are undefined, and
...
then define them to 0. S_IF* constants should be avoided.
* util.c : Whenever possible, use standard POSIX macros to test
for the file type.
Reported by Andrew V. Samoilov <sav@bcs.zp.ua>
2002-09-06 19:23:45 +00:00
Pavel Roskin
5e9c0314a2
* fs.h: Correct S_IS* definitions to use S_IFMT. Add fallback
...
definitions for S_IFDOOR and S_ISDOOR.
* screen.c (string_file_type): Remove unnesessary ifdefs, fs.h
takes care of it.
(file_compute_color): Add support for Solaris doors.
* util.c (string_perm): Remove unnesessary ifdef.
2002-09-06 00:47:46 +00:00
Pavel Roskin
9e36fa257d
* global.h: Move include for rx.h and eregex.h here.
2002-08-21 07:20:39 +00:00
Pavel Roskin
0d89dec899
* main.c: Remove extremely unsafe and poorly designed support
...
for /tmp/mc.$PID.control file.
* util.c (my_putenv): Remove, it's unused now.
2002-08-18 22:31:49 +00:00
Pavel Roskin
b9421d6927
* panel.h (struct format_e): Make string_fn return const char *.
...
Adjust all dependencies.
* screen.c (string_file_mtime): Return empty string for "..".
(string_file_atime): Likewise.
(string_file_ctime): Likewise.
2002-08-18 22:01:51 +00:00
Pavel Roskin
f0dbdeb72e
* subshell.c (read_subshell_prompt): Remove argument "how", it's
...
never set to VISIBLY. Adjust all dependencies. Eliminate hack
with "clear_now" - it causes invalid memory access and hides the
real problem.
* util.c (strip_ctrl_codes): Fix possible invalid memory access
if the escape sequence ends unexpectedly.
2002-08-15 06:53:44 +00:00
Pavel Roskin
66c5184faa
Revert undocumented change in the declaration of decompress_extension().
2002-08-15 01:45:06 +00:00
Andrew V. Samoilov
4c25b24536
* util.c (reverse_string): Speed up.
2002-08-14 16:33:50 +00:00
Pavel Roskin
6c7e1a46c8
* util.c: Remove unused functions.
...
* utilunix.c: Likewise.
* util.h: Update to match.
2002-07-29 23:12:31 +00:00
Andrew V. Samoilov
8c9c34918b
util.[ch] (app_text): Make const and adjust declaration.
2002-07-25 13:48:00 +00:00
Pavel Roskin
74288460f5
* file.c (do_transform_source): Cast the argument to functions
...
for character classification to unsigned int.
* main.c (handle_args): Likewise.
* util.c (size_trunc_sep): Likewise.
(skip_numbers): Likewise.
2002-07-03 19:47:40 +00:00
Pavel Roskin
2752379086
* util.c: Eliminate get_small_endian_long() and CHECK macro.
2002-07-02 21:25:49 +00:00
Pavel Roskin
3860ff7b34
* util.h: Rename compression types, add a type for uncompressed
...
files.
* util.c (is_gunzipable): Rename to ...
(get_compression_type): this. Don't check archive length, since
it's unreliable if there is padding at the end of the file.
Eliminate prehistoric Linux workaround. All callers adjusted.
* utilunix.c (close_error_pipe): Use "%s" in message () to
prevent possible crash.
(check_error_pipe): Likewise.
2002-07-02 21:09:25 +00:00
Pavel Roskin
7ca687c8ed
* eregex.h: Update from glibc-2.2.5.
...
* regex.c: Likewise.
* find.c: Use eregex.h, not regex.h.
* util.c: Likewise.
* view.c: Likewise.
From Alexander Varakin <avarakin00@hotmail.com>
2002-03-18 21:08:18 +00:00
Andrew V. Samoilov
aa2832dff9
* util.c [!HAVE_TRUNCATE] (truncate): Close fd if my_ftruncate
...
fails.
* util.c [HAVE_CHARSET] (is_printable): Eliminate printable.
* setup.c [HAVE_CHARSET] (load_setup): Don't use
init_printable_table().
* charset.c (printable): Removed.
(init_printable_table): Removed.
2002-02-04 18:09:42 +00:00
Pavel Roskin
030d1bf2ad
* main.h: Remove dead declarations.
...
* setup.c: Remove defunct extension alignment support.
* util.c: Likewise.
* util.h: Likewise.
2002-01-17 07:17:54 +00:00
Andrew V. Samoilov
21c015b2f8
* util.c (string_perm) [S_IFDOOR]: Support Solaris doors.
...
screen.c (string_file_type) [S_IFDOOR]: Likewise.
2002-01-09 10:54:13 +00:00
Pavel Roskin
fa89635b51
Fully eliminate all references to HAVE_X and HAVE_GNOME.
2001-11-14 23:20:37 +00:00
Pavel Roskin
7fe30fff07
* cmd.c (guess_message_value): Remove the argument. Adjust all
...
callers.
2001-09-16 00:18:39 +00:00
Pavel Roskin
13e92aca94
* layout.c: Use HAVE_TERMIOS_H and HAVE_SYS_IOCTL_H more
...
consistently.
* mouse.c: Likewise.
* subshell.c: Likewise.
* win.c: Likewise.
* util.c: Remove unused includes.
2001-09-11 02:18:02 +00:00
Pavel Roskin
c11389facb
* global.h: Include io.h, pwd.h, grp.h and utime.h. Adjust all
...
sources not to include them and to include global.h at the right
place.
2001-09-07 17:52:19 +00:00
Pavel Roskin
a8ef641beb
* x.h: Remove. Adjust all users. Make sure that global.h is
...
included instead. Don't include sys/param.h unconditionally -
rely on global.h taking care of it.
* Makefile.in: Remove x.h.
2001-09-03 05:07:40 +00:00
Pavel Roskin
1ef25591d2
* util.c (size_trunc_len): Add units parameter. Change all
...
callers.
2001-08-30 16:41:08 +00:00
Pavel Roskin
242a26c03b
* util.c (size_trunc_len): Print size values with some (little)
...
sense for tiny and even wee lengths (i.e. squeezed X terminals).
2001-08-30 16:19:45 +00:00
Pavel Roskin
b5e64692df
* util.c (strip_ctrl_codes): Rewrite using pointers. Fix
...
stripping sequences beginning with "e[". Check is_printable().
2001-08-16 03:52:51 +00:00
Andrew V. Samoilov
78dbe61c6a
* util.c [!HAVE_X] (is_printable): Don't duplicate declarations from
...
main.h.
(load_file): Use fopen and fstat to prevent race conditions.
(size_trunc): Make suffix const array.
(strip_password): Make prefixes const array.
(file_date): Make fmt auto variable.
2001-07-31 10:38:15 +00:00
Pavel Roskin
70fa991882
* util.c [!USE_VFS] (get_current_wd): Resurrect, this time using
...
g_get_current_dir().
2001-07-27 21:20:43 +00:00
Pavel Roskin
b4be52ba78
* util.c (mc_mkstemps): Don't prepend $TMPDIR if prefix contains
...
path separator.
2001-07-27 19:27:09 +00:00
Pavel Roskin
11fd4abc0e
* main.c [HAVE_X]: Disable eight_bit_clean and full_eight_bits.
...
* util.c (is_printable) [HAVE_X]: Simplify.
2001-07-26 05:01:26 +00:00
Pavel Roskin
fd895e3759
* user.c: Eliminate static variable s_editwidget. Pass
...
edit_widget as argument. All callers changed.
(expand_format): Fix expansion of %n and %b for the editor.
* util.c: Remove dead code.
2001-07-23 22:50:54 +00:00
Pavel Roskin
c19dfa9175
* util.c (get_current_wd): Remove. It's obsoleted by
...
g_get_current_dir() from glib.
2001-07-18 03:49:08 +00:00
Pavel Roskin
4349ae1c4e
* util.c (mc_mkstemps): Always use "unsigned long" for enthropy,
...
since gcc-2.7.2.1 on SunOS doesn't understand __extension__ and
checking for "long long" is not worth the trouble.
Reported by David Martin <dmartina@excite.es>
2001-07-17 18:38:46 +00:00
Pavel Roskin
a5281c3ee4
* util.c (size_trunc_len): New function - print file size to
...
a buffer of limited length.
* util.h: Declare size_trunc_len().
* screen.c (string_file_size): Use size_trunc_len().
2001-06-28 04:17:28 +00:00
Pavel Roskin
521a886013
* utilunix.c (init_my_statfs): Move this ...
...
* util.c (my_statfs): ... and this ...
* mountlist.c: ... here.
* util.h: Move mountlist-related declarations ...
* mountlist.h: ... here.
* info.c: Include mountlist.h.
2001-06-18 22:24:04 +00:00
Pavel Roskin
7205d0210c
* background.c: Include "x.h".
...
* panelize.c: Likewise.
* treestore.c: Likewise.
* user.c: Likewise.
* util.c: Likewise.
* command.c: Reorder includes. Include "x.h".
* complete.c: Likewise.
* find.c: Likewise.
* user.h: Declare user_menu_cmd() inconditionally.
* i18n.h [GAVE_GNOME]: Remove code that is now in x.h.
2001-06-15 23:37:59 +00:00
Pavel Roskin
58d8979490
* util.c (load_mc_home_file): New function. Load file from
...
mc_home, but try localized version of that file first.
* util.h: Declare load_mc_home_file().
* help.c (interactive_display): Use load_mc_home_file(). If the
first argument is NULL assume mc.hlp.
* dlg.c (dialog_handle_key): Use interactive_display() without
specifying the help file.
* tree.c (tree_copy): Likewise.
* cmd.c (help_cmd): Likewise.
(get_random_hint): Use load_mc_home_file().
2001-06-09 07:13:46 +00:00