* 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.
This commit is contained in:
Andrew V. Samoilov 2002-02-04 18:09:42 +00:00
parent 969fd8e233
commit aa2832dff9
5 changed files with 18 additions and 26 deletions

View File

@ -1,3 +1,16 @@
2002-02-04 Andrew V. Samoilov <kai@cmail.ru>
* 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.
* charsets.h: Don't declare init_printable_table ().
* charset.c (printable): Removed.
(init_printable_table): Removed.
2002-01-30 Andrew V. Samoilov <kai@cmail.ru>
* file.c (recursive_erase): Use mc_closedir() if mc_lstat()

View File

@ -15,7 +15,6 @@ struct codepage_desc *codepages;
uchar conv_displ[256];
uchar conv_input[256];
uchar printable[256];
int load_codepages_list(void)
{
@ -143,21 +142,6 @@ char errbuf[255];
*/
#define CP_ASCII 0
char* init_printable_table( int cpdisplay )
{
int i;
/* Fill printable characters table */
for (i=0; i<=127; ++i)
printable[i] = (i > 31 && i != 127);
for (i=128; i<=255; ++i) {
printable[i] = 1;
}
return NULL;
}
char* init_translation_table( int cpsource, int cpdisplay )
{
int i;

View File

@ -25,7 +25,6 @@ char *get_codepage_id( int n );
int get_codepage_index( const char *id );
int load_codepages_list(void);
void free_codepages_list(void);
char* init_printable_table( int cpdisplay );
char* init_translation_table( int cpsource, int cpdisplay );
void convert_to_display( char *str );
void convert_from_input( char *str );

View File

@ -573,7 +573,6 @@ load_setup (void)
display_codepage = get_codepage_index( cpname );
}
init_printable_table( display_codepage );
init_translation_table( source_codepage, display_codepage );
#endif /* HAVE_CHARSET */
}

View File

@ -78,13 +78,10 @@ int is_printable (int c)
c &= 0xff;
#ifdef HAVE_CHARSET
if (display_codepage < 0) {
if (xterm_flag)
return xterm_printable[c];
else
return (c > 31 && c != 127 && c != 155);
} else
return printable[ c ];
if (xterm_flag)
return xterm_printable[c];
else
return (c > 31 && c != 127 && c != 155);
#else
if (eight_bit_clean){
if (full_eight_bits){
@ -1258,9 +1255,9 @@ int truncate (const char *path, long size)
if (fd < 0)
return fd;
res = my_ftruncate (fd, size);
close (fd);
if (res < 0)
return res;
close (fd);
return 0;
}