Commit Graph

34 Commits

Author SHA1 Message Date
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 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 e5c6976b15 * util.c: Move replacements for permission bits ...
* fs.h: ... here.  Add more replacements.
* global.h: Include direct.h only with MSVC.
2002-01-22 01:23:18 +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
Timur Bakeyev 043e782496 2001-08-31 23:14:21 Timur Bakeyev <mc@bat.ru>
* utilunix.c: init_groups(), destroy_groups(), get_user_permissions()
	rewritten to use GTree structure and functions. Add new static helper
	functions mc_gid_compare() and mc_gid_destroy().

	* util.h: Removed deprecated structure user_in_groups.

	* screen.c: Fixed typo in format report error string.

2001-08-31 23:14:21  Timur Bakeyev <mc@bat.ru>

	* utilunix.c: get_user_rights() renamed into get_user_permissions().
	delete_groups() renamed into destroy_groups().
	* util.h: Likewise.
	* screen.c: Likewise.
	* main.c: Likewise.
2001-09-01 13:47:34 +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 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 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
Pavel Roskin bea09b932d * src/ext.c (exec_extension): Use mc_mkstemps().
* src/user.c (execute_menu_command): Use mc_mkstemps().
* src/util.c (mc_mkstemps): New function - safely create and
open temporary file. Return the handle and the name.
* src/util.h: Declarations for init_tmpdir() and mc_mkstemps().
Define TMPDIR_DEFAULT and SCRIPT_SUFFIX.
* vfs/direntry.c (vfs_s_open): Use mc_mkstemps. Create and close
temporary file to reserve its name on the filesystem.
(vfs_s_retrieve_file): Use mc_mkstemps().
(g_tempnam): Remove.
* vfs/extfs.c (extfs_open): Use mc_mkstemps().
* vfs/sfs.c (redirect): Likewise.
* vfs/shared_ftp_fish.c (_get_file_entry): Likewise.
(retrieve_file): Likewise.
* vfs/vfs.c (mc_def_getlocalcopy): Likewise.
* vfs/xdirentry.h: Remove declaration of g_tempnam().
2001-05-21 16:21:07 +00:00
Pavel Roskin 814ee01b63 * util.h: Remove declarations of some functions defined in
background.c.
2001-05-14 21:08:45 +00:00
Andrew V. Samoilov 40c1c50201 2000-06-14 Andrew V. Samoilov <sav@bcs.zp.ua>
* panel.h, util.[ch] (struct WPanel, size_trunc, size_trunc_sep): size
	parameters and WPanel.total field became double, thus, total size
	of selected files/directories is shown in the mini status correctly
	when it exceeds 2 GB.
2000-06-15 07:03:49 +00:00
Pavel Machek 7c13fd5558 Cleanup from Andrew. 2000-04-18 08:58:42 +00:00
Norbert Warmuth d836e5a79a 1999-09-19 Andrew V. Samoilov <sav@bcs.zp.ua>
* src/user.c (check_patterns): char* is used instead of char [] in sizeof

* src/util.c (string_perm): prefix named pipes by 'p' and not by `s'


1999-09-19  David Martin <dmartina@usa.net>

* gtkedit/editcmd.c (edit_print_string): Use unsigned char so that
8 bit chars from strftime get displayed when inserting date.

* lib/mc.ext.in: Add entries for bzip2 compressed pages as used in
Mandrake 6.0. The generic entry for bzip2 moved to the end of the
file to avoid interferences. In this one I changed the extension check
to a type check (as used for gzip) which might give problems in some
systems.

* configure.in: Use -Tlatin1 to format man pages when available and
"view" 8 bit chars.


1999-09-19  Norbert Warmuth  <nwarmuth@privat.circular.de>

* gtkedit/edit.h: Include files reordered in order to make it compile with
--with-debug

* gtkedit/editcmd.c (menu_save_mode_cmd): calculate dialog width
dependent on lenght of translated strings to display.

* src/mad.c, mad.h, util.c, util.h: Move mad-functions from util.[ch]
to mad.[ch]

* src/option.c: Include files reordered in order to make it compile with
--with-debug

* src/mad.c (mad_init): New function. Initialize debug FILE pointer to
stderr (moved to a function because not on every system stderr is
a constant).
(mad_set_debug): added const qualifier

* src/main.c (main): call mad_init

* po/*.po: s/defination/definition/

* gnome/Makefile.in ($(MAGICDEV_GENERATED)): Make it compile with $buildir
!= $srcdir.

* vfs/ftpfs.c (ftpfs_set_debug), vfs.h: added const qualifier.

* vfs/mcserv.c: removed definition of mad_strconcat which is also
in mad.c.
1999-09-19 23:09:07 +00:00
Norbert Warmuth 972271c9e2 1999-08-06 Norbert Warmuth <nwarmuth@privat.circular.de>
* gnome/gconf.h (PORT_STATIC_IN_STRING_FILE_XTIME): new port specific
feature. The Gnome edition first calls all string_file functions
and then uses the return values of these functions. Therefore additional
static buffers in string_file_[acm]time are needed.

* src/screen.c (string_file_[amc]time): These three functions use
file_date which returns a pointer to a static buffer. In the
Gnome edition this buffer has to be coppied to a static buffer
which isn't used in the other two functions (Fix Bug #1766).

* src/util.c, util.h: Moved some constants to util.h

* vfs/tar.c (read_header): Don't segfault when a symlink points to the
root directory.


1999-08-04  Norbert Warmuth  <nwarmuth@privat.circular.de>

* src/widget.c (push_history): Add SMB Link to the list of input dialogs
where urls are input without vfs prefix.

Translate the titles of these input dialogs only once.

Removed Gnome specific code because the Gnome edition doesn't use
the input history any more.

* src/util.c (strip_password): Add /#smb: to the list of urls which might
be input with password.
1999-08-06 19:24:04 +00:00
Miguel de Icaza 83378922d7 David Martina's strftime's patches 1999-04-30 12:41:41 +00:00
Miguel de Icaza 256467b407 Do not popup a window if it fails to mount the device.
Reported by Tim Janik.

Miguel.
1999-03-18 18:43:52 +00:00
Miguel de Icaza 7458010662 1999-03-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c (desktop_icon_info_open): Set the cursor to a watch
	while the icon is being opened.  Also, fixed memory leaks.
	(do_eject): Added a missing return value.
1999-03-11 19:23:23 +00:00
Norbert Warmuth 04ebcebc1b Wed Feb 3 22:27:04 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
* src/util.c (strip_password): Extented to find the url in the first
parameter. The second parameter tells whether it should search the
url (indicated by known prefixes) in the first parameter or whether
the first parameter is a url without a prefix ("ftp://", "/#ftp:",
"/#mc:").

* src/main.c (directory_history_add): Strip the password (if any) from
the freshly added value.

* src/widget.c (push_history): ditto. There's a ugly special casing
necessary for the network and ftp link dialogs (urls are entered
with out prefix).

* src/widget.c (history_put): Restrict read and write access to the
history file to the owner (Just in case I forgot to strip passwords
somewhere).


Mon Feb  1 19:32:12 1999  Norbert Warmuth  <nwarmuth@privat.circular.de>

* vfs/ftpfs.c (insert_dots): renamed from insert_dot. We have to
insert ".." as well or directories from ftp servers which don't
list "." and ".." are displayed with an additional "/".
1999-02-03 23:19:40 +00:00
Timur Bakeyev a39568367e Glibing..... (2)
Wed Jan 27 03:17:44 1999  Timur Bakeyev <mc@bat.ru>

	* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
	g_strdup()/g_free() routings. Also, copy_strings() replaced by
	g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
	g_snprintf().

	* Some sequences of malloc()/sprintf() changed to g_strdup_printf().

	* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
	a missing #undef for tempnam, which caused dead loop. Add several new
	functions to emulate GLib memory managment.

	*main.c, mad.[ch]: Add a new switch  "-M", which allows to redirect MAD
	messages to the file.

	* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
	and strdup() - we have g_ equivalences. Remove get_full_name() - it is
	similar to concat_dir_and_file(). Some other tricks with g_* functions.

	* global.h: Modified, extended. Now it is main memory mangment include -
	i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
	"util.h" and "mad.h" done there. This elimanates problem with proper or-
	der of #include's.

	* All around the source - changed order of #include's, most of them gone
	to global.h (see above), minor changes, like "0" -> NULL in string func-
	tions.
1999-01-27 01:08:30 +00:00
Timur Bakeyev f16c1a5fa1 Commit changes, that allow coexist Glib'ed VFS and not converted MC. Affects
mad.[ch], util.[ch]
1999-01-20 22:13:40 +00:00
Miguel de Icaza 85f17a4dc6 Lots of changes:
- SFS-based file systems now work on GNOME edition, I was
	  not waiting for child process to finish decompressing.

	- VFS code cleanup.  I am going to eventually get rid of all
	  the macro-mania that has creeped into the vfs layer.

Miguel
1999-01-11 00:48:23 +00:00
Pavel Machek 0512f5bf2d Missing function prototype added. 1998-09-27 19:27:04 +00:00
Pavel Machek 3d0a91d4a8 Added vfs_uid for use by libvfs.so users (rpc.nfsd)
Added single file filesystem (sfs)
Added vfs_flags so library users can disable selected filesystems
Minor shuffling of functions so garbage collection works for library
1998-08-25 16:00:16 +00:00
Norbert Warmuth ac7d5df664 Sun May 24 02:45:03 1998 Norbert Warmuth <k3190@fh-sw.de>
* utilunix.c, util.h (errno_dir_not_empty): deleted

Sat May 23 22:29:57 1998  Norbert Warmuth  <k3190@fh-sw.de>

* file.c (check_dir_is_empty): New function which takes a path and
returns -1 on error, 1 if there are no entries besides "." and
".."  in the directory path points to, 0 else. This function
actually opens and reads the directory and doesn't do tricks we
used to do with rmdir.

* file.c (erase_dir, erase_dir_iff_empty): Use check_dir_is_empty
to detect non empty directories. The old code tried to remove the
directory and decided on errno whether the failure of rmdir was
caused by a non empty directory or whether there was a different
error.
Unfortunatly not every filesystem sets errno to EDIRNOTEMPTY if
you try to delete a non empty directory. Namely the linux user
space nfs server sets errno to EIO, Suns nfs server sets it to
EEXIST and the AIX nfs server sets it to ??? (Steve reported
problems on AIX so I guess AIX sets errno to a value we currently
don't check).
1998-05-24 01:29:36 +00:00
Miguel de Icaza c752ec9d97 Reorgranized the script execution code to fix a race condition that
only happened in the GNOME code (as the execution of anything from
the file manager in the GNOME version is done in background).

Miguel.
1998-04-24 01:08:06 +00:00
Miguel de Icaza 0f31fb67d0 Fixes 80% of the bugs reported by Elliot on his last email.
This does not fix some major "problems", which require some bigger
changes to the program.

Miguel.
1998-04-17 00:21:53 +00:00
Miguel de Icaza 30252eccf8 Fixes, fixes, fixes, fixes, fixes.
Thanks DrMike for the detailed listing of problems.

Miguel.
1998-04-07 19:08:31 +00:00
Miguel de Icaza ac70e34d02 MC goes Internationallsls./gmc Spanish translation almost complete -mig 1998-03-25 05:16:00 +00:00
Pavel Machek 8665ccd219 Numerous OS/2 and NT fixes. Borland C++ for OS/2 supported 1998-03-23 05:27:15 +00:00
Miguel de Icaza c996c5ddd2 Lots 1998-03-18 06:24:20 +00:00
Miguel de Icaza b52d3a73ca Sat Mar 7 14:33:38 1998 Pavel Roskin <pavel@absolute.spb.su>
* src/complete.c: obsolete hack for OS/2 and NT removed.
        Completion works for NT now (not very good)

        * src/main.c: HOME variable is respected by NT and OS/2
        versions. If it is missing, we use LIBDIR on OS2_NT and "/"
        on Unix.

        * src/key.h: SHIFT_PRESSED is set to 0x0010 on NT. This value
        doesn't conflict with definitions for ALT and CTRL, but it is
        SDK-compatible.

        * vfs/vfs.h: Minor changes for OS/2. EMX defines mkdir with
        2 arguments

        * vfs/tcputil,c, vfs/utilvfs.c: signal.h was includes twice.

        * vfs/Makefile.in: undelfs.h is not used and should disapper

        * slang/slos2tty.c: new file, copied from SLang-0.99.38,
        needed for OS/2 port

        * slang/Makefile.in: added slos2tty.c

        * vfs/extfs/README: annoying spell errors corrected

        * src/main.c: --termcap disabled for OS2_NT because it doesn't
        (and cannot) work. ARCH_FLAGS is not needed anymore.

        * src/text.c: most includes removed. Added a warning is someone
        compiles this file with HAVE_X. Improved color scheme for
        consoles with 16 background colors (e.g. OS/2). Hack for OS/2
        removed.

        * src/util.c, src/util.h: STRCOMP and MC_ARCH_FLAGS are moved
        to util.h. It may be useful to use them for filenames' completion
        on OS2_NT
1998-03-07 20:27:44 +00:00
Miguel de Icaza eb6b3842ab Initial revision 1998-02-27 04:54:42 +00:00