home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega Top 1
/
os2_top1.zip
/
os2_top1
/
APPS
/
TEKST
/
GRECODE
/
PATCHES.OS2
< prev
next >
Wrap
Text File
|
1994-01-10
|
4KB
|
169 lines
Only in new: config.h
Only in new: Makefile.os2
Only in new: patches.os2
diff -cb orig/recode.c new/recode.c
*** orig/recode.c Wed Dec 22 04:05:20 1993
--- new/recode.c Sun Jan 09 23:40:54 1994
***************
*** 29,35 ****
`:AFTER' or `BEFORE:' are used. */
#ifndef DEFAULT_CHARSET
! #ifdef MSDOS
#define DEFAULT_CHARSET "ibmpc"
#else
#ifdef atarist
--- 29,35 ----
`:AFTER' or `BEFORE:' are used. */
#ifndef DEFAULT_CHARSET
! #if defined(MSDOS) || defined(OS2)
#define DEFAULT_CHARSET "ibmpc"
#else
#ifdef atarist
***************
*** 55,60 ****
--- 55,65 ----
#define strrchr rindex
#endif
+ #ifdef OS2
+ #include <io.h>
+ #include <fcntl.h>
+ #endif
+
#ifdef MSDOS
#include <dir.h>
#define unlink dummy1
***************
*** 1422,1433 ****
/* Choose names for intermediate files. Use "" for delaying them. */
! #ifdef MSDOS
strcpy (temp_name_1, "recodex1.tmp");
strcpy (temp_name_2, "recodex2.tmp");
#else
! *temp_name_1 = '\0';
! *temp_name_2 = '\0';
#endif
temp_input_name = temp_name_1;
temp_output_name = temp_name_2;
--- 1427,1438 ----
/* Choose names for intermediate files. Use "" for delaying them. */
! #if defined(MSDOS) || defined(OS2)
strcpy (temp_name_1, "recodex1.tmp");
strcpy (temp_name_2, "recodex2.tmp");
#else
! temp_name_1[0] = '\0';
! temp_name_2[0] = '\0';
#endif
temp_input_name = temp_name_1;
temp_output_name = temp_name_2;
***************
*** 1479,1485 ****
else
{
#ifdef USE_TMPNAM
! #ifndef MSDOS
if (*temp_output_name == '\0')
tmpnam (temp_output_name);
#endif
--- 1484,1490 ----
else
{
#ifdef USE_TMPNAM
! #if defined(MSDOS) || defined(OS2)
if (*temp_output_name == '\0')
tmpnam (temp_output_name);
#endif
***************
*** 1718,1730 ****
FILE *output_file; /* output file from recoding step */
const STEP *step; /* current step */
! #ifdef MSDOS
if (!input_name)
setmode (fileno (stdin), O_BINARY);
if (!output_name)
setmode (fileno (stdout), O_BINARY);
_fmode = O_BINARY;
#endif
if (verbose_option && input_name)
{
--- 1723,1742 ----
FILE *output_file; /* output file from recoding step */
const STEP *step; /* current step */
! #if defined(MSDOS) || defined(OS2)
if (!input_name)
setmode (fileno (stdin), O_BINARY);
if (!output_name)
setmode (fileno (stdout), O_BINARY);
+ #ifdef __EMX__
+ {
+ extern int _fmode_bin;
+ _fmode_bin = 1;
+ }
+ #else
_fmode = O_BINARY;
#endif
+ #endif
if (verbose_option && input_name)
{
***************
*** 1921,1926 ****
--- 1933,1939 ----
decoding_charset_flag ? "--list" : "--help");
else
{
+ printf ("\n%s\n\n", version_string);
printf ("\
Usage: %s [OPTION]... [CHARSET]\n", program_name);
***************
*** 2243,2249 ****
guarantee a NULL at end of charset_name_array. */
if (optind + 1 > argc)
! usage (EXIT_FAILURE);
decode_before_after (argv[optind++]);
--- 2256,2262 ----
guarantee a NULL at end of charset_name_array. */
if (optind + 1 > argc)
! usage (EXIT_SUCCESS);
decode_before_after (argv[optind++]);
***************
*** 2317,2328 ****
strcpy (output_name, input_name);
for (cursor = output_name + strlen (output_name);
cursor > output_name && cursor[-1] != '/'
! #ifdef MSDOS
! /* It has been reported this next line is also required
! for OS/2 EMX. */
&& cursor[-1] != '\\' && cursor[-1] != ':'
#endif
- && cursor[-1] != '\\' && cursor[-1] != ':'
; cursor--)
;
strcpy (cursor, "recodeXX.TMP");
--- 2330,2338 ----
strcpy (output_name, input_name);
for (cursor = output_name + strlen (output_name);
cursor > output_name && cursor[-1] != '/'
! #if defined(MSDOS) || defined(OS2)
&& cursor[-1] != '\\' && cursor[-1] != ':'
#endif
; cursor--)
;
strcpy (cursor, "recodeXX.TMP");