I haven't investigated whether there are more problems with
st_size < 0 ... Fri Apr 16 07:50:59 1999 Norbert Warmuth <nwarmuth@privat.circular.de> * src/view.c (do_view_init): Don't view files with negative file size. Added some error checking (I'm not sure whether this is needed). * src/wtools.c (message): Use g_vsnprintf instead of vsprintf. * configure.in: Linking from $srcdir/slang is broken when configure isn't called with an absolute path. Link from ../$srcdir/slang if configure was invoked with a relative path.
Этот коммит содержится в:
родитель
99d97479f0
Коммит
2fee0a42d2
@ -1,3 +1,9 @@
|
||||
Thu Apr 15 21:59:52 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* configure.in: Linking from $srcdir/slang is broken when configure
|
||||
isn't called with an absolute path. Link from ../$srcdir/slang if
|
||||
configure was invoked with a relative path.
|
||||
|
||||
1999-03-20 Nuno Ferreira <nmrf@rnl.ist.utl.pt>
|
||||
|
||||
* configure.in: Do not rm the destination file and then link, use
|
||||
|
@ -819,7 +819,7 @@ AC_ARG_WITH(included-slang,
|
||||
fi]
|
||||
)
|
||||
|
||||
AC_DEFUN(AC_WITH_SLANG,
|
||||
AC_DEFUN(AC_WITH_SLANG,[
|
||||
AC_DEFINE(HAVE_SLANG)
|
||||
search_ncurses=false
|
||||
if $slang_use_system_installed_lib
|
||||
@ -853,7 +853,10 @@ AC_DEFUN(AC_WITH_SLANG,
|
||||
CPPFLAGS="$CPPFLAGS -I../slang"
|
||||
fastdepslang=fastdepslang
|
||||
mkdir -p slang
|
||||
ln -sf $srcdir/slang/slang-mc.h slang/slang.h
|
||||
case "$srcdir" in
|
||||
/*) ln -sf $srcdir/slang/slang-mc.h slang/slang.h;;
|
||||
*) ln -sf ../$srcdir/slang/slang-mc.h slang/slang.h;;
|
||||
esac
|
||||
fi
|
||||
if $slang_check_lib
|
||||
then
|
||||
@ -871,7 +874,7 @@ AC_DEFUN(AC_WITH_SLANG,
|
||||
else
|
||||
AC_USE_TERMCAP
|
||||
fi
|
||||
fi
|
||||
fi]
|
||||
)
|
||||
|
||||
LIBSLANG=""
|
||||
|
@ -1,3 +1,12 @@
|
||||
Fri Apr 16 07:51:42 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* wtools.c (message): Use g_vsnprintf instead of vsprintf.
|
||||
|
||||
Fri Apr 16 07:50:59 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* view.c (do_view_init): Don't view files with negative file size.
|
||||
Added some error checking (I'm not sure whether this is needed).
|
||||
|
||||
1999-04-15 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* panel.h (WPanel): Added a drag_tree_row field to the WPanel
|
||||
|
22
src/view.c
22
src/view.c
@ -562,10 +562,28 @@ do_view_init (WView *view, char *_command, char *_file, int start_line)
|
||||
|
||||
{
|
||||
int fd;
|
||||
fd = mc_open(_file, O_RDONLY);
|
||||
|
||||
if ((fd = mc_open(_file, O_RDONLY)) == -1) {
|
||||
message (1, MSG_ERROR, _(" Can't open \"%s\"\n %s "),
|
||||
_file, unix_error_string (errno));
|
||||
return -1;
|
||||
}
|
||||
if (mc_fstat (fd, &view->s) == -1) {
|
||||
message (1, MSG_ERROR, _(" Can't open \"%s\"\n %s "),
|
||||
_file, unix_error_string (errno));
|
||||
mc_close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (view->s.st_size < 0) {
|
||||
message (1, MSG_ERROR, _(" Can't open \"%s\"\n File too large (%d) "),
|
||||
_file, view->s.st_size);
|
||||
return -1;
|
||||
}
|
||||
if (_file[0] && view->viewer_magic_flag && (is_gunzipable (fd, &type)) != 0)
|
||||
view->filename = g_strconcat (_file, decompress_extension(type), NULL);
|
||||
else view->filename = g_strdup (_file);
|
||||
else
|
||||
view->filename = g_strdup (_file);
|
||||
mc_close(fd);
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ Dlg_head *message (int error, char *header, char *text, ...)
|
||||
/* Setup the display information */
|
||||
strcpy (buffer, "\n");
|
||||
va_start (args, text);
|
||||
vsprintf (&buffer [1], text, args);
|
||||
g_vsnprintf (&buffer [1], sizeof (buffer), text, args);
|
||||
strcat (buffer, "\n");
|
||||
va_end (args);
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user