dos2unix-6.0.4/0000755000175500010010000000000012260366771012555 5ustar waterlanGeendos2unix-6.0.4/bcc.mak0000644000175500010010000000275012011020362013753 0ustar waterlanGeen!include version.mk CC = bcc DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" CFLAGS = $(DEFINES) -Z -O -w -mc -1 WILDARGS = c:/bc4/lib/16bit/wildargs.obj all: dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe dos2unix.exe: dos2unix.obj querycp.obj common.obj bcc -mc dos2unix.obj querycp.obj common.obj $(WILDARGS) noehc.lib unix2dos.exe: unix2dos.obj querycp.obj common.obj bcc -mc unix2dos.obj querycp.obj common.obj $(WILDARGS) noehc.lib # remove noehc.lib if you are using Borland C version prior # to 4.0. noeh?.lib, where ? stands for the memory model, # removes the C++ exception handling from the startup-code # which is included by default since Borland 4.0 and # higher. Including noeh?.lib reduces the executable size # significant, provided your source is C only. #.c.obj: # $(CC) -c $(CFLAGS) $< dos2unix.obj : dos2unix.c dos2unix.h querycp.h common.h $(CC) -c $(CFLAGS) -o$@ dos2unix.c unix2dos.obj : unix2dos.c unix2dos.h querycp.h common.h $(CC) -c $(CFLAGS) -o$@ unix2dos.c querycp.obj : querycp.c querycp.h querycp.h $(CC) -c $(CFLAGS) -o$@ querycp.c common.obj : querycp.c querycp.h common.h $(CC) -c $(CFLAGS) -o$@ common.c mac2unix.exe: dos2unix.exe copy /v dos2unix.exe mac2unix.exe unix2mac.exe: unix2dos.exe copy /v unix2dos.exe unix2mac.exe strip : tdstrip dos2unix.exe tdstrip unix2dos.exe tdstrip mac2unix.exe tdstrip unix2mac.exe clean: del *.obj del *.exe dos2unix-6.0.4/BUGS.txt0000644000175500010010000000073511674161447014064 0ustar waterlanGeenKNOWN BUGS querycp.c: query_con_codepage() The DOS 16 and 32 bit versions compiled with OpenWatcom report a wrong active code page under Windows 98. A correct code page is reported under FreeDOS. REPORTING BUGS Report bugs at the dos2unix SourceForge Tracker page http://sourceforge.net/projects/dos2unix/ Bugs tracker: http://sourceforge.net/tracker/?group_id=292083&atid=1234808 or send an email to Erwin Waterlander dos2unix-6.0.4/ChangeLog.txt0000644000175500010010000006616712260365416015160 0ustar waterlanGeen2013-12-30 Erwin Waterlander * Version 6.0.4 * man/nonlatin/man1/ru/dos2unix.pod: Removed. Russian translation of manual moved to later release. 2013-11-26 Erwin Waterlander * Makefile, common.c: When MinGW-w64 is used for 32 bit, option -V prints (MinGW-w64) for used compiler name. 2013-11-24 Erwin Waterlander * mingw32.mak: New makefile for MinGW-w64 targeting win32. MinGW-w64 supports Large File Support (LFS) with -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 while mingw.org doesn't. Dos2unix failed when concurrent dos2unix processes processed huge files on Windows network share drives. Using MinGW-w64 with LFS support fixed the problem. Thanks to report by F.J. Brandelik. 2013-10-07 Erwin Waterlander * Makefile: Set MAN_NONLATIN back to 1. Include non-Latin manuals in source package to prevent compilation troubles. Target 'clean' keeps non-Latin manuals. Use 'maintainer-clean' to erase them. 2013-10-05 Erwin Waterlander * Makefile: By default don't build non-Latin1 manuals. There are still too many old perl/pod2man versions around (perl < 5.10.1). Add MAN_NONLATIN=1 to enable non-Latin1 manuals. 2013-10-01 Erwin Waterlander * man/man1/Makefile: Support non-Latin1 man pages. * Makefile: Support non-Latin1 man pages. * man/nonlatin/man1/ru/dos2unix.pod: Placeholder for Russian manual. 2013-09-13 Андрей Углик (Andrei Uhlik) * po/ru.po: New Russian translation of the messages. 2013-08-05 Erwin Waterlander * po/de.po: Update German translations. Thanks to Lars Wendler. 2013-06-14 Erwin Waterlander * dos2unix.c/unix2dos.c: New options -ul and -ub to convert UTF-16 files without BOM. 2013-06-11 Erwin Waterlander * dos2unix.c/unix2dos.c: Print value of binary symbol when found. 2013-03-12 Erwin Waterlander * Makefile: Set CC to gcc for MSYS target. Otherwise /mingw/bin/cc is used. 2013-01-27 Erwin Waterlander * Makefile: - CC and CPP can be overridden by environment. - CFLAGS optimization flags can be overridden by environment. - Separate LIBS from LDFLAGS. Thanks to Justin Lecher 2013-01-25 Erwin Waterlander * Version 6.0.3 2013-01-18 Erwin Waterlander * dos2unix.c/unix2dos.c: Print system error when writing to temporary output file fails. 2013-01-16 Erwin Waterlander * dos2unix.c/unix2dos.c: Print system error when closing of temporary output file fails. E.g. "No space left on device". 2012-12-25 Erwin Waterlander * querycp.c/h: Added public domain phrase for Debian license check. 2012-12-12 Erwin Waterlander * test: New directory with some test files. 2012-09-20 Erwin Waterlander * man/man1/Makefile: Removed dependency on 'sed' program. 2012-09-19 Erwin Waterlander * vc.mak: Visual C++ version supports wildcard expansion. Added targets 'install', 'uninstall', 'doc', 'dist', 'txt', 'html', and 'mostlyclean'. * INSTALL.txt: Update for Visual C++. 2012-09-16 Erwin Waterlander * *.c/*.h: Dos2unix compiles with Microsoft Visual C++. * vc.mak: New makefile for Microsoft Visual C++. * INSTALL.txt: Update for Visual C++. 2012-09-15 Erwin Waterlander * Makefile: Better check for DJGPP. DJGPP 2.04 uname returns "FreeDOS" on Freedos, 2.03 uname returns always "MS-DOS". Thanks to Rugxulo. * man/man1/dos2unix.pod: Fixed a typo. Thanks to Jari Aalto. 2012-09-06 Erwin Waterlander * Version 6.0.2 2012-08-29 Erwin Waterlander * wcc*: Fix target 'dist' in Watcom makefiles. * djgpp.mak: Use 8.3 filename for dos32 binary package. 2012-08-26 Erwin Waterlander * os2.mak: Renamed to emx.mak. * wccos2.mak: New Watcom C makefile for OS/2 target. * wcc.mif: Watcom C makefile with generic parts. This new makefile containts new targets 'install', 'uninstall', 'doc', 'dist', and 'mostlyclean'. * djgpp.mak: Default prefix is now c:\dos32 * dos16_gnu.mak: Removed. Installation of dos16 version is now done with Watcom makefiles. 2012-08-13 Erwin Waterlander * po/de.po: Update German translations. Thanks to Philipp. * po/es.po: Update Spanish translations. Thanks to Julio. 2012-08-12 Erwin Waterlander * Makefile: Don't use pod2text option --utf8. There are too many old pod2text versions around that don't support this option. * Makefile: Install PDF and PostScript files of all languages when they have been created. * po/eo*.po: Update Esperanto translations. Thanks to Rugxulo. * dos2unix/unix2dos: Don't use __MSDOS__ macro for Windows. 2012-08-10 Erwin Waterlander * Makefile: Change variable OS to D2U_OS. OS is used by Windows. * Makefile: By default install only English text and html manuals. This saves a dependency on iconv. Non-English text and html manuals will be installed when they have been explicitly generated with targets 'txt' and 'html'. 2012-08-09 Erwin Waterlander * dos2unix/unix2dos: Use only C99 compliant predefined macros. 2012-08-07 Erwin Waterlander * dos2unix/unix2dos: Print line number when a binary symbol is found. Thanks to Somsak Pattanaprateep. * Makefile: By default install text and html manuals of all languages. 2012-08-06 Erwin Waterlander * dos2unix/unix2dos: Fix. Locale encoding was not detected when NLS was disabled. * common.c: Update comments. Surrogate halves in UTF-8 are invalid. 2012-07-25 Erwin Waterlander * Version 6.0.1 2012-07-20 Erwin Waterlander * Makefile: Target 'html' makes also Dutch and Spanish HTML manuals. 2012-07-18 Erwin Waterlander * manual: Update for options -n and -o. Describe the new permissions of the output file in new-file and old-file mode. * README.txt: Added references for the findutils package for Windows and DOS to enable recursive conversions on those platforms. 2012-05-20 Erwin Waterlander * common.h: Fix compiler warnings "implicit declaration of function 'strcasecmp'". Thanks to Michael Schindler . 2012-05-11 Julio A. Freyre-Gonzalez * Update Spanish messages and manual. 2012-05-06 Erwin Waterlander * Version 6.0 * man/*/man1/*.pod: Removed =encoding. It is not supported by perl 5.8.8, which is shipped with MinGW and DJGPP. 2012-04-20 Erwin Waterlander * man/*/man1/*.pod: Set encoding explicitly to Latin-1. * Makefile: Target 'doc' makes all man pages. 2012-04-12 Erwin Waterlander * po/de.po: Update German translations. Thanks to Philipp Thomas. 2012-04-09 Erwin Waterlander * INSTALL.txt: List the prerequisites. * Makefile: Friendlier for DJGPP/MinGW/MSYS. 2012-04-04 Erwin Waterlander * po/eo.po: Update Esperanto translations. Thanks to Rugxulo. 2012-03-30 Erwin Waterlander * Skip UTF-16 file when conversion to UTF-8 goes wrong. * Update English and Dutch manual. 2012-03-28 Erwin Waterlander * common.c: Support UTF-16 surrogate pairs. * dos2unix.c, unix2dos.c: Check wchar_t size. 2012-03-26 Erwin Waterlander * *.c: Use fgetc/fputc instead of getc/putc. 2012-03-25 Erwin Waterlander * po, man: Update Dutch translations. 2012-03-24 Erwin Waterlander * On Unix, convert UTF-16 files only when the locale encoding is UTF-8 to prevent accidental loss of text. 2012-03-23 Erwin Waterlander * Turn off ISO and 7-bit mode if an Unicode text file is detected, to prevent corruption of UTF-8 files. * Update English manual. * Fix compilation for WatcomC, DJGPP, MSYS, OS/2. * Makefile: Support CFLAGS_USER, LDFLAGS_USER, and DEFS_USER for Debian Linux. Thanks to Jari Aalto. 2012-03-21 Erwin Waterlander * Support conversion of Unicode UTF-16 from stdin. * Update English manual. 2012-03-20 Erwin Waterlander * Support conversion of Unicode UTF-16 encoded files. 2012-03-16 Erwin Waterlander * common.c: Make it compile on Cygwin 1.5. 2012-03-10 Erwin Waterlander * Version 5.3.3 * Makefile: Binary packages with native language support get "-nls" suffix. 2012-03-08 Erwin Waterlander * common.c: Option -V prints target OS on DOS/Windows/OS2. 2012-03-07 Erwin Waterlander * dos2unix.c, unix2dos.c, mingw64.mak: Enabled wildcard expansion for Win64 (MinGW-w64). Thanks to Steve Hay. * wccdos16.mak: Enabled wildcard expansion. * wccdos32.mak: Enabled wildcard expansion. * wccwin32.mak: Enabled wildcard expansion. * bcc.mak: Enabled wildcard expansion. 2012-03-02 Erwin Waterlander * Makefile: New target 'mostlyclean' that preserves the manual files. Target 'clean' removes all built files, it restores the Unix source package to its original state. * Makefile: New variable HTMLEXT to override the default 'htm' extension for the manual in HTML format. 2012-02-01 Erwin Waterlander * Makefile, version.mk: Fix a compile error when debug is enabled. Thanks to Maurizio Camisaschi and Lars Wendler. See https://bugs.gentoo.org/400769 * Makefile: Enable debugging info for gdb when DEBUG=1 * man page: Small update in section RETURN VALUE. 2012-01-27 Erwin Waterlander * Version 5.3.2 2012-01-02 Erwin Waterlander * os2.mak: Enable support for wild cards (-Zargs-wild). Thanks to Steven H. Levine and Elbert Pol. 2011-12-20 Erwin Waterlander * querycp.c: Extra comment from Rugxulo. * querycp.c: Undid change of 2011-11-12. MSYS version behaves as Cygwin version. 2011-12-15 Erwin Waterlander * wccdos32.mak: New makefile for Open Watcom for DOS32. 2011-12-06 Erwin Waterlander * Makefile: Undo previous change for Darwin. Not restoring group and owner may be destructive or a security risk. * Makefile, common.[ch]: Dos2unix builds on MSYS now. 2011-12-02 Erwin Waterlander * Makefile: For MacOS the option -DNO_CHOWN has been be added to the compile time flags. This is necessary because Darwin will create files with the file-owner-group set to the file-owner-group of the directory - EVEN if the caller is not a member of the group! Chowning *from* the group is ok, chowning *to* the group is not - and this will make unix2dos fail when it tries to restore the permissions. Thanks to Wolf Geldmacher. See bug report 3444337, https://sourceforge.net/tracker/?func=detail&atid=1234808&aid=3444337&group_id=292083 2011-11-16 Erwin Waterlander * README.txt, man/man1/dos2unix.pod: Freshmeat changed name to Freecode. 2011-11-12 Erwin Waterlander * querycp.c: Fix for MSYS. 2011-10-20 Erwin Waterlander * querycp.c: Support OS/2, and Watcom C for Win32. * wccwin32.mak: New makefile for Open Watcom for Win32. 2011-08-22 Erwin Waterlander * Makefile: Added RPM_OPT_FLAGS to LDFLAGS. Required for cross-platform RPM package building. 2011-08-20 Erwin Waterlander * Home page URL: change to http://waterlan.home.xs4all.nl/dos2unix.html 2011-08-09 Erwin Waterlander * Version 5.3.1 2011-08-08 Julio A. Freyre-Gonzalez * Spanish translation of messages and manual. 2011-06-26 Erwin Waterlander * bugfix: dos2unix changes ownership and permissions on file. When an other user (e.g. root) than the owner has write permission on the input file, dos2unix changes owner, group and umask in old file mode to the other user's owner, group and umask who runs dos2unix. Fixed only for Unix. Thanks to Christopher Williams. See http://sourceforge.net/tracker/?func=detail&aid=3327171&group_id=292083&atid=1234808 * Keep permissions also on Windows. Use chmod() i.s.o. fchmod(). 2011-06-16 Erwin Waterlander * Identical functions from dos2unix.c and unix2dos.c are moved to common.c. 2011-06-15 Erwin Waterlander * Dos2unix and Unix2dos share the same language files. 2011-05-04 Erwin Waterlander * dos2unix.c: Removed redundant ConvertDosToUnixOldFile(). * unix2dos.c: Removed redundant ConvertUnixToDosOldFile(). 2011-04-26 Erwin Waterlander * Version 5.3 2011-04-23 Erwin Waterlander * Don't report an error when unlink() fails because a file doesn't exist. 2011-04-13 Erwin Waterlander * Print system error when input file can't be openened. For instance "Permission denied" * Update manuals. * Update translations. 2011-04-04 Erwin Waterlander * Always print and return an error when wrong command-line options are used. Also in quiet mode. * New option '--': Treat all following options as file names. 2011-04-03 Erwin Waterlander * Improved error reporting. Return system error when an error occurs. * Don't quit after first error (like rm, ls, grep, tar). * In quiet mode the return value is always zero. 2011-03-27 Erwin Waterlander * dos2unix.c/unix2dos.c: Check if symbolic links point to regular files. * dos2unix.c/unix2dos.c: Added short options -F, -R, -S. * po: update translations. 2011-03-24 Erwin Waterlander * dos2unix.c/unix2dos.c: Changed options --follow, --no-follow, to --follow-symlink, --replace-symlink, --skip-symlink. * dos2unix.c/unix2dos.c: Options --force and --safe are only to covert binary files or skip them. * dos2unix.c/unix2dos.c: Non-regular files that are not symbolic links are never converted. 2011-03-23 Charles Wilson * dos2unix.c/unix2dos.c: New options --follow and --no-follow. In follow mode dos2unix writes to the symlink target, instead of replacing the symbolic link with an output file. 2011-03-22 Charles Wilson * querycp.c: Behave on Cygwin same as on Linux. Default code page in ISO mode is CP437. 2011-03-21 Charles Wilson * dos2unix.c/unix2dos.c: - Cygwin may define WIN32 (via include files). - bugfix: Cygwin: set mode to binary in stdio mode conversion. Needed in case non-Cygwin program launches dos2unix. - bugfix: set failure mode if rename fails in quiet mode. - New option: -s, --safe. Opposite of -f, --force. * Makefile: Cleanup for Cygwin. 2011-03-19 Erwin Waterlander * Makefile: Install links instead of binary/manpage copies on Cygwin. 2011-03-05 Erwin Waterlander * man/man1/dos2unix.pod: Replace GPL with FreeBSD license. * man/nl/man1/dos2unix.pod: Replace GPL with FreeBSD license. 2011-03-04 Erwin Waterlander * Version 5.2.1 2011-03-03 Erwin Waterlander * Don't print used code page in quiet mode. 2011-03-02 Erwin Waterlander * Esperanto x-notation format is optional. Default is Unicode. There is no installation of an 'eo-x' locale any more. Add EO_XNOTATION=1 to make command-line to select x-notation. It will change the format of the normal 'eo' locale from Unicode to ASCII x-notation. 2011-02-28 Erwin Waterlander * Makefile: Make LFS optional with variable LFS (default on). * dos2unix.c/unix2dos.c: Print file name with stat() system error. 2011-02-26 Erwin Waterlander * dos2unix.c/unix2dos.c: Report system error when stat() fails. * Makefile: Enable 64 bit file system interface (_FILE_OFFSET_BITS=64). This enables opening files larger than 2GB on 32 bit systems, provided the system has Large File Support (LFS). See also section 1.3.4 "Feature Test Macros" of The GNU C Library manual. http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html 2011-02-22 Erwin Waterlander * In debug mode file mode is printed (compile with DEBUG=1). 2011-02-19 Erwin Waterlander * Makefile: Generation of PostScript and PDF is optional. This removes dependency on Groff and GhostScript (thanks to Philipp Thomas). 2011-02-04 Erwin Waterlander * Makefile: Replace GPL (accidently patched in) with FreeBSD license. * man/man1/Makefile: Fix perl command for for DOS alike file systems (Can't do inplace edit without backup.). (thanks to Elbert Pol) 2011-01-31 Erwin Waterlander * Version 5.2 2011-01-19 Erwin Waterlander * Update manual. 2011-01-13 Rugxulo * querycp.c: Active code page detection. DOS 16 bit, OpenWatcom. 2011-01-12 Erwin Waterlander * querycp.c: Detect active code page for ISO mode on Windows. 2011-01-12 Rugxulo * querycp.c: Detect active code page for ISO mode. DOS 32 bit, DJGPP. 2011-01-11 Erwin Waterlander * New ISO conversion modes DOS CP860 (Portuguese) and CP863 (French Canadian). 2011-01-10 Erwin Waterlander * New ISO conversion mode DOS CP865 (Nordic). 2011-01-07 Erwin Waterlander * ISO mode CP437: fix conversion of non-breaking space (NBSP) * New ISO conversion modes: DOS CP850 (Western European) and Windows CP1252 (Western European). * SunOS compatible command-line options -ascii, -iso, -7, -437, -850. 2011-01-04 Erwin Waterlander * 7bit and iso mode can be used in Mac mode. 2010-11-22 Jari Aalto * Small updates man page and Makefile. 2010-11-21 Ben Pfaff * Don't indicate text files with ASCII Form Feed control characters (^L) as binary. Form feed characters are fairly common in GNU software text files, because the GNU coding standards advice to use form feeds to divide text into pages. 2010-11-15 Erwin Waterlander * Put full copyright text in *.h source files (FSF's recommendation). Thanks to Jari Aalto . * Don't include generated documentation files in Unix source package. * Create a source package in DOS text format. 2010-08-18 Erwin Waterlander * version 5.1.1 2010-07-23 Erwin Waterlander * Added Dutch translation of the manual. 2010-07-19 Erwin Waterlander * MinGW-w64 Makefile added for Windows 64 bit port. 2010-06-20 Erwin Waterlander * Don't ship po/*.mo files in source package. * Win32 binary package uses patched MinGW's libintl, with builtin relocation support. See http://www.xs4all.nl/~waterlan/libintl.html 2010-04-22 Erwin Waterlander * Support compilation in DOSBox (8.3 file names where needed). 2010-04-14 Erwin Waterlander * Fixed compilation on Darwin OS. Thanks to Marc Gianzero. 2010-04-03 Erwin Waterlander * version 5.1 2010-03-22 Erwin Waterlander * Man page generation from Perl POD file. Thanks to Jari Aalto * Merge dos2unix and unix2dos man pages. 2010-03-17 Erwin Waterlander * Add localization information to manual. 2010-03-16 Rugxulo * Added Esperanto translation. 2010-03-13 Erwin Waterlander * DJGPP, dos32bit: Create 'stubs' for mac2unix and unix2mac. See also http://www.delorie.com/djgpp/v2faq/faq22_5.html Thanks to Rugxulo 2010-03-11 Erwin Waterlander * Allow to set options in stdio mode. * dos2unix: bugfix MAC mode: Don't change DOS line endings. * Display help if a wrong option was used. 2010-03-04 Erwin Waterlander * Port to 16 bit DOS, using OpenWatcom. 2010-03-03 Erwin Waterlander * Port to 16 bit DOS, using Borland C. 2010-02-16 Erwin Waterlander * version 5.0 2010-02-15 Erwin Waterlander * unix2dos: Fix problem of reading Mac files. * unix2dos: Added command 'unix2mac'. * unix2dos: Can use DOS2UNIX_LOCALEDIR i.s.o. UNIX2DOS_LOCALEDIR. * dos2unix: 'mac2unix' command can have a prefix. * Makefile: mac2unix and unix2mac are installed as soft links. 2010-02-13 Erwin Waterlander * Bundled dos2unix and unix2dos in one package. * dos2unix/unix2dos : Cleanup messages and manual. * dos2unix: Option -l --newline also works in MAC mode. * unix2dos: Added option -l, --newline. * unix2dos: Added MAC mode. Convert Unix line endings to Mac line endings. 2010-02-10 Erwin Waterlander * unix2dos: Makefile : - Use GNU standard directory variables everywhere. - New target 'dist-tbz' creates bzip2 compressed archive. 2010-02-10 Philipp Thomas * unix2dos: po/de.po : Added German translation. * unix2dos: Makefile : - Added $(RPM_OPT_FLAGS) to CFLAGS. - Use DESTDIR only in install and uninstall targets (not in variables, this is more common practice). 2010-02-03 Erwin Waterlander * dos2unix: Makefile : - Use GNU standard directory variables everywhere. 2010-02-03 Philipp Thomas * dos2unix: po/de.po : Added German translation. * dos2unix: Makefile : - Use GNU standard directory variable 'datadir' i.s.o. 'sharedir'. - Added $(RPM_OPT_FLAGS) to CFLAGS. - New target 'dist-tbz' creates bzip2 compressed archive. - Use DESTDIR only in install and uninstall targets (not in variables, this is more common practice). 2010-02-02 Erwin Waterlander * dos2unix/unix2dos: Update Dutch translation. 2010-01-24 Erwin Waterlander * dos2unix/unix2dos: version 4.1.2 2010-01-22 Tim Waugh * dos2unix/unix2dos: Preserve file mode in 'new file mode'. * dos2unix/unix2dos: Makefile: Allow CFLAGS to be set externally. 2010-01-21 Erwin Waterlander * dos2unix/unix2dos: version 4.1.1 * dos2unix/unix2dos: Fix compilation on FreeBSD. * dos2unix/unix2dos: Changed home page URL to http://www.xs4all.nl/~waterlan/dos2unix.html 2009-12-28 Erwin Waterlander * dos2unix/unix2dos: version 4.1 * dos2unix/unix2dos: Automatically skip binary files. * dos2unix/unix2dos: Automatically skip non-regular files. * dos2unix/unix2dos: New option: -f --force: Force conversion of all files. * dos2unix/unix2dos: Option -h: Print options in alphabetical order. * dos2unix/unix2dos: Update manual. * dos2unix/unix2dos: ISO mode: - Non-convertable characters are converted to a dot. Old conversion risked conversion to unwanted ISO C1 control characters from ISO 6429. - Fixed wrong conversion of Interpunct. - Don't convert ASCII control characters DC4 (Pilcrow, 0x14) and NAK (Section-sign, 0x15). 2009-12-21 Erwin Waterlander * dos2unix/unix2dos: version 4.0.1 * dos2unix/unix2dos: man page improvements: Thanks to Jari Aalto . - Replace hyphens with minus signs (look like dashes) where needed. - Options in alphabetical order. * dos2unix/unix2dos: man page: Update ISO mode information. * dos2unix/unix2dos: Option -V prints localedir used. * dos2unix: Localedir can be overruled with environment variable DOS2UNIX_LOCALEDIR. * unix2dos: Localedir can be overruled with environment variable UNIX2DOS_LOCALEDIR. * dos2unix/unix2dos: Fixed two wrong conversions in ISO mode: - Greek mu. - Closing guillemet (angle quotation mark, >>). * dos2unix/unix2dos: Port to OS/2 Warp: Thanks to Elbert Pol . * dos2unix/unix2dos: Makefiles: Added target 'strip'. 2009-12-15 Erwin Waterlander * dos2unix/unix2dos: version 4.0 * dos2unix/unix2dos: Added internationalisation using gettext. * dos2unix/unix2dos: Added Dutch translation. * dos2unix/unix2dos: Ported to Win32 using Mingw32 * dos2unix/unix2dos: Ported to DOS using DJGPP * dos2unix/unix2dos: Fixed problem in DOS/Windows stdio mode. * dos2unix/unix2dos: New option -L/--license that prints software license. * dos2unix/unix2dos: Code cleanup * dos2unix/unix2dos: Update manual 2009-12-04 Erwin Waterlander * dos2unix: version 3.2 * unix2dos: version 2.3 * dos2unix/unix2dos: version.mk: New file. * dos2unix/unix2dos: README: New file. * dos2unix/unix2dos: ChangeLog : New file. * dos2unix: INSTALL: Updated. * dos2unix/unix2dos: Makefile: Makefile according GNU standards. * unix2dos: INSTALL: New file. * dos2unix: Applied all patches from RedHat: - use mkstemp i.s.o. mktemp: Nov 17 2000 Tim Powers - segfault: Jan 17 2002 Bernhard Rosenkraenzer - safeconv: Oct 20 2004 Miloslav Trmac - manpage-update: Oct 6 2004 Mike A. Harris - preserve-file-modes: Feb 6 2007 Tim Waugh - tmppath: Apr 13 2005 Tim Waugh - c-missing-arg: Jan 18 2008 Tim Waugh - Remove trailing white space. * unix2dos: Applied all patches from RedHat: - use mkstemp i.s.o. mktemp: Nov 17 2000 Tim Powers - segfault: Jan 17 2002 Bernhard Rosenkraenzer - manpage-update: Oct 6 2004 Mike A. Harris - preserve-file-modes: Oct 11 2004 Tim Waugh - tmppath: Apr 13 2005 Tim Waugh - Remove trailing white space. 1998-11-19 Christian Wurll * dos2unix: version 3.1 * dos2unix: Added extra newline if ^M occurs 1998-02-04 Bernd Johannes Wuebben * dos2unix: version 3.0 * dos2unix: Added Mac text file translation, i.e. \r to \n conversion 1995-03-30 Benjamin Lin * dos2unix/unix2dos: version 2.2 * dos2unix: Fixed a bug in 2.1 where in new file mode, if outfile already exists * dos2unix: conversion can not be completed properly. * unix2dos: Conversion from SunOS charset implemented. 1995-03-29 Benjamin Lin * dos2unix: version 2.1 * dos2unix: Conversion to SunOS charset implemented. 1995-03-19 Benjamin Lin * dos2unix/unix2dos: version 2.0 * dos2unix/unix2dos: Rewritten from scratch. 1995-03-16 Benjamin Lin * dos2unix: version 1.2 * unix2dos: version 1.3 * dos2unix/unix2dos: Modified to more conform to UNIX style. 1995-03-09 Benjamin Lin * unix2dos: version 1.2 * unix2dos: Fixed minor typo error 1994-12-20 Benjamin Lin * dos2unix/unix2dos: version 1.1 * dos2unix/unix2dos: Cleaned up for Borland C/C++ 4.02 1989-10-04 John Birchfield * dos2unix/unix2dos: version 1.0 dos2unix-6.0.4/common.c0000644000175500010010000004624412245223471014213 0ustar waterlanGeen/* * Copyright (C) 2009-2013 Erwin Waterlander * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice in the documentation and/or other materials provided with * the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "common.h" #if defined(D2U_UNICODE) #if defined(_WIN32) || defined(__CYGWIN__) #include #endif #endif #if defined(__GLIBC__) /* on glibc, canonicalize_file_name() broken prior to 2.4 (06-Mar-2006) */ # if __GNUC_PREREQ (2,4) # define USE_CANONICALIZE_FILE_NAME 1 # endif #elif defined(__CYGWIN__) /* on cygwin, canonicalize_file_name() available since api 0/213 */ /* (1.7.0beta61, 25-Sep-09) */ # include # if (CYGWIN_VERSION_DLL_COMBINED >= 213) && (CYGWIN_VERSION_DLL_MAJOR >= 1007) # define USE_CANONICALIZE_FILE_NAME 1 # endif #endif /****************************************************************** * * int symbolic_link(char *path) * * test if *path points to a file that exists and is a symbolic link * * returns 1 on success, 0 when it fails. * ******************************************************************/ int symbolic_link(char *path) { #ifdef S_ISLNK struct stat buf; if (STAT(path, &buf) == 0) { if (S_ISLNK(buf.st_mode)) return(1); } #endif return(0); } /****************************************************************** * * int regfile(char *path, int allowSymlinks) * * test if *path points to a regular file (or is a symbolic link, * if allowSymlinks != 0). * * returns 0 on success, -1 when it fails. * ******************************************************************/ int regfile(char *path, int allowSymlinks, CFlag *ipFlag, char *progname) { struct stat buf; char *errstr; if (STAT(path, &buf) == 0) { #if DEBUG fprintf(stderr, "%s: %s MODE 0%o ", progname, path, buf.st_mode); #ifdef S_ISSOCK if (S_ISSOCK(buf.st_mode)) fprintf(stderr, " (socket)"); #endif #ifdef S_ISLNK if (S_ISLNK(buf.st_mode)) fprintf(stderr, " (symbolic link)"); #endif if (S_ISREG(buf.st_mode)) fprintf(stderr, " (regular file)"); #ifdef S_ISBLK if (S_ISBLK(buf.st_mode)) fprintf(stderr, " (block device)"); #endif if (S_ISDIR(buf.st_mode)) fprintf(stderr, " (directory)"); if (S_ISCHR(buf.st_mode)) fprintf(stderr, " (character device)"); if (S_ISFIFO(buf.st_mode)) fprintf(stderr, " (FIFO)"); fprintf(stderr, "\n"); #endif if ((S_ISREG(buf.st_mode)) #ifdef S_ISLNK || (S_ISLNK(buf.st_mode) && allowSymlinks) #endif ) return(0); else return(-1); } else { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, path, errstr); } return(-1); } } /****************************************************************** * * int regfile_target(char *path) * * test if *path points to a regular file (follow symbolic link) * * returns 0 on success, -1 when it fails. * ******************************************************************/ int regfile_target(char *path, CFlag *ipFlag, char *progname) { struct stat buf; char *errstr; if (stat(path, &buf) == 0) { if (S_ISREG(buf.st_mode)) return(0); else return(-1); } else { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, path, errstr); } return(-1); } } void PrintBSDLicense(void) { fprintf(stderr, "%s", _("\ Redistribution and use in source and binary forms, with or without\n\ modification, are permitted provided that the following conditions\n\ are met:\n\ 1. Redistributions of source code must retain the above copyright\n\ notice, this list of conditions and the following disclaimer.\n\ 2. Redistributions in binary form must reproduce the above copyright\n\ notice in the documentation and/or other materials provided with\n\ the distribution.\n\n\ \ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n\ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n\ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n\ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n\ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n\ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n\ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n\ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\ ")); } void PrintUsage(char *progname) { fprintf(stderr, _("\ %s %s (%s)\n\ Usage: %s [options] [file ...] [-n infile outfile ...]\n\ -ascii convert only line breaks (default)\n\ -iso conversion between DOS and ISO-8859-1 character set\n\ -1252 Use Windows code page 1252 (Western European)\n\ -437 Use DOS code page 437 (US) (default)\n\ -850 Use DOS code page 850 (Western European)\n\ -860 Use DOS code page 860 (Portuguese)\n\ -863 Use DOS code page 863 (French Canadian)\n\ -865 Use DOS code page 865 (Nordic)\n\ -7 Convert 8 bit characters to 7 bit space\n\ -c, --convmode conversion mode\n\ convmode ascii, 7bit, iso, mac, default to ascii\n\ -f, --force force conversion of binary files\n\ -h, --help give this help\n\ -k, --keepdate keep output file date\n\ -L, --license display software license\n\ -l, --newline add additional newline\n\ -m, --add-bom add UTF-8 Byte Order Mark\n\ -n, --newfile write to new file\n\ infile original file in new file mode\n\ outfile output file in new file mode\n\ -o, --oldfile write to old file (default)\n\ file ... files to convert in old file mode\n\ -q, --quiet quiet mode, suppress all warnings\n\ always on in stdio mode\n\ -s, --safe skip binary files (default)\n"), progname, VER_REVISION, VER_DATE, progname); #ifdef D2U_UNICODE fprintf(stderr, _("\ -ul, --assume-utf16le Assume that the input format is UTF-16LE\n\ -ub, --assume-utf16be Assume that the input format is UTF-16BE\n")); #endif #ifdef S_ISLNK fprintf(stderr, _("\ -F, --follow-symlink follow symbolic links and convert the targets\n\ -R, --replace-symlink replace symbolic links with converted files\n\ (original target files remain unchanged)\n\ -S, --skip-symlink keep symbolic links and targets unchanged (default)\n")); #endif fprintf(stderr, _("\ -V, --version display version number\n")); } #define MINGW32_W64 1 void PrintVersion(char *progname) { fprintf(stderr, "%s %s (%s)\n", progname, VER_REVISION, VER_DATE); #if DEBUG fprintf(stderr, "VER_AUTHOR: %s\n", VER_AUTHOR); #endif #if defined(__WATCOMC__) && defined(__I86__) fprintf(stderr, "%s", _("DOS 16 bit version (WATCOMC).\n")); #elif defined(__TURBOC__) && defined(__MSDOS__) fprintf(stderr, "%s", _("DOS 16 bit version (TURBOC).\n")); #elif defined(__WATCOMC__) && defined(__DOS__) fprintf(stderr, "%s", _("DOS 32 bit version (WATCOMC).\n")); #elif defined(__DJGPP__) fprintf(stderr, "%s", _("DOS 32 bit version (DJGPP).\n")); #elif defined(__MSYS__) fprintf(stderr, "%s", _("MSYS version.\n")); #elif defined(__CYGWIN__) fprintf(stderr, "%s", _("Cygwin version.\n")); #elif defined(__WIN64__) && defined(__MINGW64__) fprintf(stderr, "%s", _("Windows 64 bit version (MinGW-w64).\n")); #elif defined(__WATCOMC__) && defined(__NT__) fprintf(stderr, "%s", _("Windows 32 bit version (WATCOMC).\n")); #elif defined(_WIN32) && defined(__MINGW32__) && (D2U_COMPILER == MINGW32_W64) fprintf(stderr, "%s", _("Windows 32 bit version (MinGW-w64).\n")); #elif defined(_WIN32) && defined(__MINGW32__) fprintf(stderr, "%s", _("Windows 32 bit version (MinGW).\n")); #elif defined(_WIN64) && defined(_MSC_VER) fprintf(stderr,_("Windows 64 bit version (MSVC %d).\n"),_MSC_VER); #elif defined(_WIN32) && defined(_MSC_VER) fprintf(stderr,_("Windows 32 bit version (MSVC %d).\n"),_MSC_VER); #elif defined (__OS2__) && defined(__WATCOMC__) /* OS/2 Warp */ fprintf(stderr, "%s", _("OS/2 version (WATCOMC).\n")); #elif defined (__OS2__) && defined(__EMX__) /* OS/2 Warp */ fprintf(stderr, "%s", _("OS/2 version (EMX).\n")); #endif #ifdef D2U_UNICODE fprintf(stderr, "%s", _("With Unicode UTF-16 support.\n")); #else fprintf(stderr, "%s", _("Without Unicode UTF-16 support.\n")); #endif #ifdef ENABLE_NLS fprintf(stderr, "%s", _("With native language support.\n")); #else fprintf(stderr, "%s", "Without native language support.\n"); #endif } #ifdef ENABLE_NLS void PrintLocaledir(char *localedir) { fprintf(stderr, "LOCALEDIR: %s\n", localedir); } #endif /* opens file of name ipFN in read only mode * RetVal: NULL if failure * file stream otherwise */ FILE* OpenInFile(char *ipFN) { return (fopen(ipFN, R_CNTRL)); } /* opens file of name ipFN in write only mode * RetVal: NULL if failure * file stream otherwise */ FILE* OpenOutFile(int fd) { return (fdopen(fd, W_CNTRL)); } #if defined(__TURBOC__) || defined(__MSYS__) || defined(_MSC_VER) char *dirname(char *path) { char *ptr; if (( path == NULL) || (((ptr=strrchr(path,'/')) == NULL) && ((ptr=strrchr(path,'\\')) == NULL)) ) return "."; else { *ptr = '\0'; return(path); } } #endif #ifdef NO_MKSTEMP FILE* MakeTempFileFrom(const char *OutFN, char **fname_ret) #else int MakeTempFileFrom(const char *OutFN, char **fname_ret) #endif { char *cpy = strdup(OutFN); char *dir = NULL; size_t fname_len = 0; char *fname_str = NULL; #ifdef NO_MKSTEMP char *name; FILE *fd = NULL; #else int fd = -1; #endif *fname_ret = NULL; if (!cpy) goto make_failed; dir = dirname(cpy); fname_len = strlen(dir) + strlen("/d2utmpXXXXXX") + sizeof (char); if (!(fname_str = malloc(fname_len))) goto make_failed; sprintf(fname_str, "%s%s", dir, "/d2utmpXXXXXX"); *fname_ret = fname_str; free(cpy); #ifdef NO_MKSTEMP name = mktemp(fname_str); *fname_ret = name; if ((fd = fopen(fname_str, W_CNTRL)) == NULL) goto make_failed; #else if ((fd = mkstemp(fname_str)) == -1) goto make_failed; #endif return (fd); make_failed: free(*fname_ret); *fname_ret = NULL; #ifdef NO_MKSTEMP return (NULL); #else return (-1); #endif } /* Test if *lFN is the name of a symbolic link. If not, set *rFN equal * to lFN, and return 0. If so, then use canonicalize_file_name or * realpath to determine the pointed-to file; the resulting name is * stored in newly allocated memory, *rFN is set to point to that value, * and 1 is returned. On error, -1 is returned and errno is set as * appropriate. * * Note that if symbolic links are not supported, then 0 is always returned * and *rFN = lFN. * * RetVal: 0 if success, and *lFN is not a symlink * 1 if success, and *lFN is a symlink * -1 otherwise */ int ResolveSymbolicLink(char *lFN, char **rFN, CFlag *ipFlag, char *progname) { int RetVal = 0; #ifdef S_ISLNK struct stat StatBuf; char *errstr; char *targetFN = NULL; if (STAT(lFN, &StatBuf)) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, lFN, errstr); } RetVal = -1; } else if (S_ISLNK(StatBuf.st_mode)) { #if USE_CANONICALIZE_FILE_NAME targetFN = canonicalize_file_name(lFN); if (!targetFN) { if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, lFN, errstr); ipFlag->error = 1; } RetVal = -1; } else { *rFN = targetFN; RetVal = 1; } #else /* Sigh. Use realpath, but realize that it has a fatal * flaw: PATH_MAX isn't necessarily the maximum path * length -- so realpath() might fail. */ targetFN = (char *) malloc(PATH_MAX * sizeof(char)); if (!targetFN) { if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, lFN, errstr); ipFlag->error = 1; } RetVal = -1; } else { /* is there any platform with S_ISLNK that does not have realpath? */ char *rVal = realpath(lFN, targetFN); if (!rVal) { if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, lFN, errstr); ipFlag->error = 1; } free(targetFN); RetVal = -1; } else { *rFN = rVal; RetVal = 1; } } #endif /* !USE_CANONICALIZE_FILE_NAME */ } else *rFN = lFN; #else /* !S_ISLNK */ *rFN = lFN; #endif /* !S_ISLNK */ return RetVal; } FILE *read_bom (FILE *f, int *bomtype) { int bom[3]; /* BOMs * UTF16-LE ff fe * UTF16-BE fe ff * UTF-8 ef bb bf */ *bomtype = FILE_MBS; /* Check for BOM */ if (f != NULL) { if ((bom[0] = fgetc(f)) == EOF) { ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } if ((bom[0] != 0xff) && (bom[0] != 0xfe) && (bom[0] != 0xef)) { ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } if ((bom[1] = fgetc(f)) == EOF) { ungetc(bom[1], f); ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } if ((bom[0] == 0xff) && (bom[1] == 0xfe)) /* UTF16-LE */ { *bomtype = FILE_UTF16LE; return(f); } if ((bom[0] == 0xfe) && (bom[1] == 0xff)) /* UTF16-BE */ { *bomtype = FILE_UTF16BE; return(f); } if ((bom[2] = fgetc(f)) == EOF) { ungetc(bom[2], f); ungetc(bom[1], f); ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } if ((bom[0] == 0xef) && (bom[1] == 0xbb) && (bom[2]== 0xbf)) /* UTF-8 */ { *bomtype = FILE_UTF8; return(f); } ungetc(bom[2], f); ungetc(bom[1], f); ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } return(f); } #ifdef D2U_UNICODE wint_t d2u_getwc(FILE *f, int bomtype) { int c_trail, c_lead; wint_t wc; if (((c_lead=fgetc(f)) == EOF) || ((c_trail=fgetc(f)) == EOF)) return(WEOF); if (bomtype == FILE_UTF16LE) /* UTF16 little endian */ { c_trail <<=8; wc = (wint_t)(c_trail + c_lead) ; } else { /* UTF16 big endian */ c_lead <<=8; wc = (wint_t)(c_trail + c_lead) ; } return(wc); } wint_t d2u_ungetwc(wint_t wc, FILE *f, int bomtype) { int c_trail, c_lead; if (bomtype == FILE_UTF16LE) /* UTF16 little endian */ { c_trail = (int)(wc & 0xff00); c_trail >>=8; c_lead = (int)(wc & 0xff); } else { /* UTF16 big endian */ c_lead = (int)(wc & 0xff00); c_lead >>=8; c_trail = (int)(wc & 0xff); } /* push back in reverse order */ if ((ungetc(c_trail,f) == EOF) || (ungetc(c_lead,f) == EOF)) return(WEOF); return(wc); } /* Put wide character */ wint_t d2u_putwc(wint_t wc, FILE *f, CFlag *ipFlag) { static char mbs[8]; static wchar_t lead, trail; static wchar_t wstr[3]; size_t i,len; if ((wc >= 0xd800) && (wc < 0xdc00)) { /* fprintf(stderr, "UTF-16 lead %x\n",wc); */ lead = (wchar_t)wc; /* lead (high) surrogate */ return(wc); } if ((wc >= 0xdc00) && (wc < 0xe000)) { /* fprintf(stderr, "UTF-16 trail %x\n",wc); */ trail = (wchar_t)wc; /* trail (low) surrogate */ #if defined(_WIN32) || defined(__CYGWIN__) /* On Windows (including Cygwin) wchar_t is 16 bit */ /* We cannot decode an UTF-16 surrogate pair, because it will not fit in a 16 bit wchar_t. */ wstr[0] = lead; wstr[1] = trail; wstr[2] = L'\0'; #else /* On Unix wchar_t is 32 bit */ /* When we don't decode the UTF-16 surrogate pair, wcstombs() does not * produce the same UTF-8 as WideCharToMultiByte(). The UTF-8 output * produced by wcstombs() is bigger, because it just translates the wide * characters in the range 0xD800..0xDBFF individually to UTF-8 sequences * (although these code points are reserved for use only as surrogate * pairs in UTF-16). * * Some smart viewers can still display this UTF-8 correctly (like Total * Commander lister), however the UTF-8 is not readable by Windows * Notepad (on Windows 7). When we decode the UTF-16 surrogate pairs * ourselves the wcstombs() UTF-8 output is identical to what * WideCharToMultiByte() produces, and is readable by Notepad. * * Surrogate halves in UTF-8 are invalid. See also * http://en.wikipedia.org/wiki/UTF-8#Invalid_code_points * http://tools.ietf.org/html/rfc3629#page-5 * It is a bug in (some implemenatations of) wcstombs(). * On Cygwin 1.7 wcstombs() produces correct UTF-8 from UTF-16 surrogate pairs. */ /* Decode UTF-16 surrogate pair */ wstr[0] = 0x10000; wstr[0] += (lead & 0x03FF) << 10; wstr[0] += (trail & 0x03FF); wstr[1] = L'\0'; /* fprintf(stderr, "UTF-32 %x\n",wstr[0]); */ #endif } else { wstr[0] = (wchar_t)wc; wstr[1] = L'\0'; } #if defined(_WIN32) || defined(__CYGWIN__) /* On Windows we convert UTF-16 always to UTF-8 */ len = (size_t)(WideCharToMultiByte(CP_UTF8, 0, wstr, -1, mbs, sizeof(mbs), NULL, NULL) -1); #else /* On Unix we convert UTF-16 to the locale encoding */ len = wcstombs(mbs, wstr, sizeof(mbs)); /* fprintf(stderr, "len %d\n",len); */ #endif if ( len == (size_t)(-1) ) { /* Stop when there is a conversion error */ ipFlag->status |= UNICODE_CONVERSION_ERROR ; return(WEOF); } else { for (i=0; i #define _(String) gettext (String) #define gettext_noop(String) String #define N_(String) gettext_noop (String) #else #define _(String) (String) #define N_(String) String #define textdomain(Domain) #define bindtextdomain(Package, Directory) #endif #if defined(__DJGPP__) || defined(__TURBOC__) /* DJGPP */ # include #else # if !defined(__MSYS__) && !defined(_MSC_VER) # include # endif #endif #if !defined(__TURBOC__) && !defined(_MSC_VER) #include #endif #include #include #include #ifdef __GNUC__ #ifndef strcmpi # include # define strcmpi(s1, s2) strcasecmp(s1, s2) #endif #endif #ifdef _MSC_VER # include #else # include #endif #include #ifdef __TURBOC__ #define __FLAT__ #endif #include #include #ifdef D2U_UNICODE #include #endif #if (defined(__WATCOMC__) && defined(__NT__)) /* Watcom */ # define _WIN32 1 #endif #if defined(__WATCOMC__) && defined(__I86__) /* Watcom C, 16 bit Intel */ #define __MSDOS__ 1 #endif #if defined(__WATCOMC__) && defined(__DOS__) /* Watcom C, 32 bit DOS */ #define __MSDOS__ 1 #endif #if defined(ENABLE_NLS) || (defined(D2U_UNICODE) && !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__)) /* setlocale() is also needed for nl_langinfo() */ #include #endif #if defined(__TURBOC__) || defined(__DJGPP__) || defined(__MINGW32__) || defined(_MSC_VER) /* Some compilers have no mkstemp(). * Use mktemp() instead. * BORLANDC, DJGPP, MINGW32 */ #define NO_MKSTEMP 1 #endif #if defined(__TURBOC__) || defined(__DJGPP__) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(_MSC_VER) /* Some compilers have no chown(). */ #define NO_CHOWN 1 #endif /* Watcom C defines S_ISLNK */ #ifdef __WATCOMC__ #undef S_ISLNK #endif /* Microsoft Visual C++ */ #ifdef _MSC_VER #define S_ISCHR( m ) (((m) & _S_IFMT) == _S_IFCHR) #define S_ISDIR( m ) (((m) & _S_IFMT) == _S_IFDIR) #define S_ISFIFO( m ) (((m) & _S_IFMT) == _S_IFIFO) #define S_ISREG( m ) (((m) & _S_IFMT) == _S_IFREG) #define NO_CHMOD 1 /* no chmod() available */ #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) /* Systems without soft links use 'stat' instead of 'lstat'. */ #define STAT stat #else #define STAT lstat #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) /* On some systems rename() will always fail if target file already exists. */ #define NEED_REMOVE 1 #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) /* DJGPP, MINGW32 and OS/2 */ /* required for setmode() and O_BINARY */ #include #include #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) #define R_CNTRL "rb" #define W_CNTRL "wb" #else #define R_CNTRL "r" #define W_CNTRL "w" #endif #define BINARY_FILE 0x1 #define NO_REGFILE 0x2 #define WRONG_CODEPAGE 0x4 #define OUTPUTFILE_SYMLINK 0x8 #define INPUT_TARGET_NO_REGFILE 0x10 #define OUTPUT_TARGET_NO_REGFILE 0x20 #define LOCALE_NOT_UTF8 0x40 #define WCHAR_T_TOO_SMALL 0x80 #define UNICODE_CONVERSION_ERROR 0x100 #define CONVMODE_ASCII 0 #define CONVMODE_UTF16LE 1 #define CONVMODE_UTF16BE 2 #define CONVMODE_7BIT 3 #define CONVMODE_437 437 #define CONVMODE_850 850 #define CONVMODE_860 860 #define CONVMODE_863 863 #define CONVMODE_865 865 #define CONVMODE_1252 1252 #define FROMTO_DOS2UNIX 0 #define FROMTO_MAC2UNIX 1 #define FROMTO_UNIX2DOS 0 #define FROMTO_UNIX2MAC 1 #define SYMLINK_SKIP 0 #define SYMLINK_FOLLOW 1 #define SYMLINK_REPLACE 2 #define FILE_MBS 0 /* Multi-byte string or 8-bit char */ #define FILE_UTF16LE 1 /* UTF-16 Little Endian */ #define FILE_UTF16BE 2 /* UTF-16 Big Endian */ #define FILE_UTF8 3 /* UTF-8 */ typedef struct { int NewFile; /* is in new file mode? */ int Quiet; /* is in quiet mode? */ int KeepDate; /* should keep date stamp? */ int ConvMode; /* 0: ascii, 1: 7bit, 2: iso */ int FromToMode; /* 0: dos2unix/unix2dos, 1: mac2unix/unix2mac */ int NewLine; /* if TRUE, then additional newline */ int Force; /* if TRUE, force conversion of all files. */ int Follow; /* 0: skip symlink, 1: follow symbolic link, 2: replace symlink. */ int status; int stdio_mode; /* if TRUE, stdio mode */ int error; /* an error occurred */ int bomtype; /* byte order mark */ int add_bom; /* 1: write BOM */ } CFlag; int symbolic_link(char *path); int regfile(char *path, int allowSymlinks, CFlag *ipFlag, char *progname); int regfile_target(char *path, CFlag *ipFlag, char *progname); void PrintUsage(char *progname); void PrintBSDLicense(void); void PrintVersion(char *progname); #ifdef ENABLE_NLS void PrintLocaledir(char *localedir); #endif FILE* OpenInFile(char *ipFN); FILE* OpenOutFile(int fd); #if defined(__TURBOC__) || defined(__MSYS__) char *dirname(char *path); #endif #ifdef NO_MKSTEMP FILE* MakeTempFileFrom(const char *OutFN, char **fname_ret); #else int MakeTempFileFrom(const char *OutFN, char **fname_ret); #endif int ResolveSymbolicLink(char *lFN, char **rFN, CFlag *ipFlag, char *progname); FILE *read_bom (FILE *f, int *bomtype); #ifdef D2U_UNICODE wint_t d2u_getwc(FILE *f, int bomtype); wint_t d2u_ungetwc(wint_t wc, FILE *f, int bomtype); wint_t d2u_putwc(wint_t wc, FILE *f, CFlag *ipFlag); #endif dos2unix-6.0.4/COPYING.txt0000644000175500010010000000266012075622673014432 0ustar waterlanGeenThe dos2unix package is distributed under FreeBSD style license. See also http://www.freebsd.org/copyright/freebsd-license.html -------- Copyright (C) 2009-2013 Erwin Waterlander Copyright (C) 1998 Christian Wurll Copyright (C) 1998 Bernd Johannes Wuebben Copyright (C) 1994-1995 Benjamin Lin. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. dos2unix-6.0.4/djgpp.mak0000644000175500010010000000245312235307262014347 0ustar waterlanGeen # Author: Erwin Waterlander # Copyright (C) 2009-2012 Erwin Waterlander # This file is distributed under the same license as the dos2unix package. include version.mk prefix=c:/dos32 #ENABLE_NLS=1 ENABLE_NLS= VERSIONSUFFIX=-dos32 ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv NLS_SUFFIX = -nls endif VERSIONSUFFIX = pm ZIPFILE = d2u$(DOS2UNIX_VERSION_SHORT)$(VERSIONSUFFIX)$(NLS_SUFFIX).zip ZIPOBJ_EXTRA = bin/cwsdpmi.exe docsubdir = dos2unix all: $(MAKE) all EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK_MAN="cp -f" docsubdir=$(docsubdir) EO_XNOTATION=1 UCS= MAN_NONLATIN= install: $(MAKE) install EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK_MAN="cp -f" docsubdir=$(docsubdir) EO_XNOTATION=1 UCS= MAN_NONLATIN= uninstall: $(MAKE) uninstall EXE=.exe prefix=$(prefix) docsubdir=$(docsubdir) MAN_NONLATIN= clean: $(MAKE) clean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) mostlyclean: $(MAKE) mostlyclean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) dist: $(MAKE) dist-zip EXE=.exe prefix=$(prefix) VERSIONSUFFIX="$(VERSIONSUFFIX)" ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" ENABLE_NLS=$(ENABLE_NLS) ZIPFILE=${ZIPFILE} docsubdir=$(docsubdir) strip: $(MAKE) strip LINK_MAN="cp -f" EXE=.exe dos2unix-6.0.4/dos2unix.c0000644000175500010010000011736612156705567014516 0ustar waterlanGeen/* * Name: dos2unix * Documentation: * Remove cr ('\x0d') characters from a file. * * The dos2unix package is distributed under FreeBSD style license. * See also http://www.freebsd.org/copyright/freebsd-license.html * -------- * * Copyright (C) 2009-2013 Erwin Waterlander * Copyright (C) 1998 Christian Wurll * Copyright (C) 1998 Bernd Johannes Wuebben * Copyright (C) 1994-1995 Benjamin Lin. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice in the documentation and/or other materials provided with * the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * == 1.0 == 1989.10.04 == John Birchfield (jb@koko.csustan.edu) * == 1.1 == 1994.12.20 == Benjamin Lin (blin@socs.uts.edu.au) * Cleaned up for Borland C/C++ 4.02 * == 1.2 == 1995.03.16 == Benjamin Lin (blin@socs.uts.edu.au) * Modified to more conform to UNIX style. * == 2.0 == 1995.03.19 == Benjamin Lin (blin@socs.uts.edu.au) * Rewritten from scratch. * == 2.1 == 1995.03.29 == Benjamin Lin (blin@socs.uts.edu.au) * Conversion to SunOS charset implemented. * == 2.2 == 1995.03.30 == Benjamin Lin (blin@socs.uts.edu.au) * Fixed a bug in 2.1 where in new file mode, if outfile already exists * conversion can not be completed properly. * * Added Mac text file translation, i.e. \r to \n conversion * Bernd Johannes Wuebben, wuebben@kde.org * Wed Feb 4 19:12:58 EST 1998 * * Added extra newline if ^M occurs * Christian Wurll, wurll@ira.uka.de * Thu Nov 19 1998 * * See ChangeLog.txt for complete version history. * */ /* #define DEBUG 1 */ #include "common.h" #include "dos2unix.h" #include "querycp.h" #ifdef D2U_UNICODE #if !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__) /* Unix, Cygwin */ # include #endif #endif void PrintLicense(void) { fprintf(stderr, "%s", _("\ Copyright (C) 2009-2013 Erwin Waterlander\n\ Copyright (C) 1998 Christian Wurll (Version 3.1)\n\ Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n\ Copyright (C) 1994-1995 Benjamin Lin\n\ All rights reserved.\n\n")); PrintBSDLicense(); } #ifdef D2U_UNICODE void StripDelimiterW(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, wint_t CurChar) { wint_t TempNextChar; /* CurChar is always CR (x0d) */ /* In normal dos2unix mode put nothing (skip CR). */ /* Don't modify Mac files when in dos2unix mode. */ if ( (TempNextChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { d2u_ungetwc( TempNextChar, ipInF, ipFlag->bomtype); /* put back peek char */ if ( TempNextChar != 0x0a ) { d2u_putwc( CurChar, ipOutF, ipFlag); /* Mac line, put back CR */ } } else if ( CurChar == 0x0d ) { /* EOF: last Mac line delimiter (CR)? */ d2u_putwc( CurChar, ipOutF, ipFlag); } if (ipFlag->NewLine) { /* add additional LF? */ d2u_putwc(0x0a, ipOutF, ipFlag); } } #endif void StripDelimiter(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, int CurChar) { int TempNextChar; /* CurChar is always CR (x0d) */ /* In normal dos2unix mode put nothing (skip CR). */ /* Don't modify Mac files when in dos2unix mode. */ if ( (TempNextChar = fgetc(ipInF)) != EOF) { ungetc( TempNextChar, ipInF ); /* put back peek char */ if ( TempNextChar != '\x0a' ) { fputc( CurChar, ipOutF ); /* Mac line, put back CR */ } } else if ( CurChar == '\x0d' ) { /* EOF: last Mac line delimiter (CR)? */ fputc( CurChar, ipOutF ); } if (ipFlag->NewLine) { /* add additional LF? */ fputc('\x0a', ipOutF); } } /* converts stream ipInF to UNIX format text and write to stream ipOutF * RetVal: 0 if success * -1 otherwise */ #ifdef D2U_UNICODE int ConvertDosToUnixW(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, char *progname) { int RetVal = 0; wint_t TempChar; wint_t TempNextChar; int line_nr = 1; char *errstr; ipFlag->status = 0; /* CR-LF -> LF */ /* LF -> LF, in case the input file is a Unix text file */ /* CR -> CR, in dos2unix mode (don't modify Mac file) */ /* CR -> LF, in Mac mode */ /* \x0a = Newline/Line Feed (LF) */ /* \x0d = Carriage Return (CR) */ switch (ipFlag->FromToMode) { case FROMTO_DOS2UNIX: /* dos2unix */ while ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { /* get character */ if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != 0x0a) && /* Not an LF */ (TempChar != 0x0d) && /* Not a CR */ (TempChar != 0x09) && /* Not a TAB */ (TempChar != 0x0c)) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Binary symbol 0x00%02X found at line %d\n"),TempChar, line_nr); } break; } if (TempChar != 0x0d) { if (TempChar == 0x0a) /* Count all DOS and Unix line breaks */ ++line_nr; if (d2u_putwc(TempChar, ipOutF, ipFlag) == WEOF) { RetVal = -1; if (!ipFlag->Quiet) { if (!(ipFlag->status & UNICODE_CONVERSION_ERROR)) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } } break; } } else { StripDelimiterW( ipInF, ipOutF, ipFlag, TempChar ); } } break; case FROMTO_MAC2UNIX: /* mac2unix */ while ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != 0x0a) && /* Not an LF */ (TempChar != 0x0d) && /* Not a CR */ (TempChar != 0x09) && /* Not a TAB */ (TempChar != 0x0c)) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Binary symbol 0x00%02X found at line %d\n"),TempChar, line_nr); } break; } if ((TempChar != 0x0d)) { if (TempChar == 0x0a) /* Count all DOS and Unix line breaks */ ++line_nr; if(d2u_putwc(TempChar, ipOutF, ipFlag) == WEOF){ RetVal = -1; if (!ipFlag->Quiet) { if (!(ipFlag->status & UNICODE_CONVERSION_ERROR)) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } } break; } } else{ /* TempChar is a CR */ if ( (TempNextChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { ungetc( TempNextChar, ipInF ); /* put back peek char */ /* Don't touch this delimiter if it's a CR,LF pair. */ if ( TempNextChar == 0x0a ) { d2u_putwc(0x0d, ipOutF, ipFlag); /* put CR, part of DOS CR-LF */ continue; } } if (d2u_putwc(0x0a, ipOutF, ipFlag) == WEOF) /* MAC line end (CR). Put LF */ { RetVal = -1; if (!ipFlag->Quiet) { if (!(ipFlag->status & UNICODE_CONVERSION_ERROR)) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } } break; } line_nr++; /* Count all Mac line breaks */ if (ipFlag->NewLine) { /* add additional LF? */ d2u_putwc(0x0a, ipOutF, ipFlag); } } } break; default: /* unknown FromToMode */ ; #if DEBUG fprintf(stderr, "%s: ", progname); fprintf(stderr, _("program error, invalid conversion mode %d\n"),ipFlag->FromToMode); exit(1); #endif } return RetVal; } #endif /* converts stream ipInF to UNIX format text and write to stream ipOutF * RetVal: 0 if success * -1 otherwise */ int ConvertDosToUnix(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, char *progname) { int RetVal = 0; int TempChar; int TempNextChar; int *ConvTable; int line_nr = 1; char *errstr; ipFlag->status = 0; switch (ipFlag->ConvMode) { case CONVMODE_ASCII: /* ascii */ case CONVMODE_UTF16LE: /* Assume UTF-16LE */ case CONVMODE_UTF16BE: /* Assume UTF-16BE */ ConvTable = D2UAsciiTable; break; case CONVMODE_7BIT: /* 7bit */ ConvTable = D2U7BitTable; break; case CONVMODE_437: /* iso */ ConvTable = D2UIso437Table; break; case CONVMODE_850: /* iso */ ConvTable = D2UIso850Table; break; case CONVMODE_860: /* iso */ ConvTable = D2UIso860Table; break; case CONVMODE_863: /* iso */ ConvTable = D2UIso863Table; break; case CONVMODE_865: /* iso */ ConvTable = D2UIso865Table; break; case CONVMODE_1252: /* iso */ ConvTable = D2UIso1252Table; break; default: /* unknown convmode */ ipFlag->status |= WRONG_CODEPAGE ; return(-1); } if ((ipFlag->ConvMode > 1) && (!ipFlag->Quiet)) /* not ascii or 7bit */ { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("using code page %d.\n"), ipFlag->ConvMode); } /* CR-LF -> LF */ /* LF -> LF, in case the input file is a Unix text file */ /* CR -> CR, in dos2unix mode (don't modify Mac file) */ /* CR -> LF, in Mac mode */ /* \x0a = Newline/Line Feed (LF) */ /* \x0d = Carriage Return (CR) */ switch (ipFlag->FromToMode) { case FROMTO_DOS2UNIX: /* dos2unix */ while ((TempChar = fgetc(ipInF)) != EOF) { /* get character */ if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != '\x0a') && /* Not an LF */ (TempChar != '\x0d') && /* Not a CR */ (TempChar != '\x09') && /* Not a TAB */ (TempChar != '\x0c')) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Binary symbol 0x%02X found at line %d\n"),TempChar, line_nr); } break; } if (TempChar != '\x0d') { if (TempChar == '\x0a') /* Count all DOS and Unix line breaks */ ++line_nr; if (fputc(ConvTable[TempChar], ipOutF) == EOF) { RetVal = -1; if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } break; } } else { StripDelimiter( ipInF, ipOutF, ipFlag, TempChar ); } } break; case FROMTO_MAC2UNIX: /* mac2unix */ while ((TempChar = fgetc(ipInF)) != EOF) { if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != '\x0a') && /* Not an LF */ (TempChar != '\x0d') && /* Not a CR */ (TempChar != '\x09') && /* Not a TAB */ (TempChar != '\x0c')) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Binary symbol 0x%02X found at line %d\n"),TempChar, line_nr); } break; } if ((TempChar != '\x0d')) { if (TempChar == '\x0a') /* Count all DOS and Unix line breaks */ ++line_nr; if(fputc(ConvTable[TempChar], ipOutF) == EOF){ RetVal = -1; if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } break; } } else{ /* TempChar is a CR */ if ( (TempNextChar = fgetc(ipInF)) != EOF) { ungetc( TempNextChar, ipInF ); /* put back peek char */ /* Don't touch this delimiter if it's a CR,LF pair. */ if ( TempNextChar == '\x0a' ) { fputc('\x0d', ipOutF); /* put CR, part of DOS CR-LF */ continue; } } if (fputc('\x0a', ipOutF) == EOF) /* MAC line end (CR). Put LF */ { RetVal = -1; if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } break; } line_nr++; /* Count all Mac line breaks */ if (ipFlag->NewLine) { /* add additional LF? */ fputc('\x0a', ipOutF); } } } break; default: /* unknown FromToMode */ ; #if DEBUG fprintf(stderr, "%s: ", progname); fprintf(stderr, _("program error, invalid conversion mode %d\n"),ipFlag->FromToMode); exit(1); #endif } return RetVal; } /* convert file ipInFN to UNIX format text and write to file ipOutFN * RetVal: 0 if success * -1 otherwise */ int ConvertDosToUnixNewFile(char *ipInFN, char *ipOutFN, CFlag *ipFlag, char *progname) { int RetVal = 0; FILE *InF = NULL; FILE *TempF = NULL; char *TempPath; char *errstr; struct stat StatBuf; struct utimbuf UTimeBuf; #ifndef NO_CHMOD mode_t mask; #endif #ifdef NO_MKSTEMP FILE* fd; #else int fd; #endif char *TargetFN = NULL; int ResolveSymlinkResult = 0; ipFlag->status = 0 ; /* Test if output file is a symbolic link */ if (symbolic_link(ipOutFN) && !ipFlag->Follow) { ipFlag->status |= OUTPUTFILE_SYMLINK ; /* Not a failure, skipping input file according spec. (keep symbolic link unchanged) */ return -1; } /* Test if input file is a regular file or symbolic link */ if (regfile(ipInFN, 1, ipFlag, progname)) { ipFlag->status |= NO_REGFILE ; /* Not a failure, skipping non-regular input file according spec. */ return -1; } /* Test if input file target is a regular file */ if (symbolic_link(ipInFN) && regfile_target(ipInFN, ipFlag,progname)) { ipFlag->status |= INPUT_TARGET_NO_REGFILE ; /* Not a failure, skipping non-regular input file according spec. */ return -1; } /* Test if output file target is a regular file */ if (symbolic_link(ipOutFN) && (ipFlag->Follow == SYMLINK_FOLLOW) && regfile_target(ipOutFN, ipFlag,progname)) { ipFlag->status |= OUTPUT_TARGET_NO_REGFILE ; /* Failure, input is regular, cannot produce output. */ if (!ipFlag->error) ipFlag->error = 1; return -1; } /* retrieve ipInFN file date stamp */ if (stat(ipInFN, &StatBuf)) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, ipInFN, errstr); } RetVal = -1; } #ifdef NO_MKSTEMP if((fd = MakeTempFileFrom(ipOutFN, &TempPath))==NULL) { #else if((fd = MakeTempFileFrom (ipOutFN, &TempPath)) < 0) { #endif if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Failed to open temporary output file: %s\n"), errstr); } RetVal = -1; } #if DEBUG fprintf(stderr, "%s: ", progname); fprintf(stderr, _("using %s as temporary file\n"), TempPath); #endif /* can open in file? */ if (!RetVal) { InF=OpenInFile(ipInFN); if (InF == NULL) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, ipInFN, errstr); RetVal = -1; } } /* can open output file? */ if ((!RetVal) && (InF)) { #ifdef NO_MKSTEMP if ((TempF=fd) == NULL) { #else if ((TempF=OpenOutFile(fd)) == NULL) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s\n", progname, errstr); #endif fclose (InF); InF = NULL; RetVal = -1; } } InF = read_bom(InF, &ipFlag->bomtype); #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16LE)) ipFlag->bomtype = FILE_UTF16LE; if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16BE)) ipFlag->bomtype = FILE_UTF16BE; #endif #ifdef D2U_UNICODE #if !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__) /* Unix, Cygwin */ if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { if (strcmp(nl_langinfo(CODESET), "UTF-8") != 0) { /* Don't convert UTF-16 files when the locale encoding is not UTF-8 * to prevent loss of characters. */ ipFlag->status |= LOCALE_NOT_UTF8 ; if (!ipFlag->error) ipFlag->error = 1; RetVal = -1; } } #endif #if !defined(_WIN32) && !defined(__CYGWIN__) /* Not Windows or Cygwin */ if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { if (sizeof(wchar_t) < 4) { /* A decoded UTF-16 surrogate pair must fit in a wchar_t */ ipFlag->status |= WCHAR_T_TOO_SMALL ; if (!ipFlag->error) ipFlag->error = 1; RetVal = -1; } } #endif #endif if (ipFlag->add_bom) fprintf(TempF, "%s", "\xEF\xBB\xBF"); /* UTF-8 BOM */ /* Turn off ISO and 7-bit conversion for Unicode text files */ /* When we assume UTF16, don't change the conversion mode. We need to remember it. */ if ((ipFlag->bomtype > 0) && (ipFlag->ConvMode != CONVMODE_UTF16LE) && (ipFlag->ConvMode != CONVMODE_UTF16BE)) ipFlag->ConvMode = CONVMODE_ASCII; /* conversion sucessful? */ #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { if ((!RetVal) && (ConvertDosToUnixW(InF, TempF, ipFlag, progname))) RetVal = -1; if (ipFlag->status & UNICODE_CONVERSION_ERROR) { if (!ipFlag->error) ipFlag->error = 1; RetVal = -1; } } else { if ((!RetVal) && (ConvertDosToUnix(InF, TempF, ipFlag, progname))) RetVal = -1; } #else if ((!RetVal) && (ConvertDosToUnix(InF, TempF, ipFlag, progname))) RetVal = -1; #endif /* can close in file? */ if ((InF) && (fclose(InF) == EOF)) RetVal = -1; /* can close output file? */ if (TempF) { if (fclose(TempF) == EOF) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Failed to write to temporary output file %s: %s\n"), TempPath, errstr); } RetVal = -1; } } #ifdef NO_MKSTEMP if(fd!=NULL) fclose(fd); #else if(fd>=0) close(fd); #endif #ifndef NO_CHMOD if (!RetVal) { if (ipFlag->NewFile == 0) /* old file mode */ { RetVal = chmod (TempPath, StatBuf.st_mode); /* set original permissions */ } else { mask = umask(0); /* get process's umask */ umask(mask); /* set umask back to original */ RetVal = chmod(TempPath, StatBuf.st_mode & ~mask); /* set original permissions, minus umask */ } if (RetVal) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Failed to change the permissions of temporary output file %s: %s\n"), TempPath, errstr); } } } #endif #ifndef NO_CHOWN if (!RetVal && (ipFlag->NewFile == 0)) /* old file mode */ { /* Change owner and group of the the tempory output file to the original file's uid and gid. */ /* Required when a different user (e.g. root) has write permission on the original file. */ /* Make sure that the original owner can still access the file. */ if (chown(TempPath, StatBuf.st_uid, StatBuf.st_gid)) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Failed to change the owner and group of temporary output file %s: %s\n"), TempPath, errstr); } RetVal = -1; } } #endif if ((!RetVal) && (ipFlag->KeepDate)) { UTimeBuf.actime = StatBuf.st_atime; UTimeBuf.modtime = StatBuf.st_mtime; /* can change output file time to in file time? */ if (utime(TempPath, &UTimeBuf) == -1) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, TempPath, errstr); } RetVal = -1; } } /* any error? cleanup the temp file */ if (RetVal && (TempPath != NULL)) { if (unlink(TempPath) && (errno != ENOENT)) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, TempPath, errstr); } RetVal = -1; } } /* If output file is a symbolic link, optional resolve the link and modify */ /* the target, instead of removing the link and creating a new regular file */ TargetFN = ipOutFN; if (symbolic_link(ipOutFN) && !RetVal) { ResolveSymlinkResult = 0; /* indicates that TargetFN need not be freed */ if (ipFlag->Follow == SYMLINK_FOLLOW) { ResolveSymlinkResult = ResolveSymbolicLink(ipOutFN, &TargetFN, ipFlag, progname); if (ResolveSymlinkResult < 0) { if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("problems resolving symbolic link '%s'\n"), ipOutFN); fprintf(stderr, _(" output file remains in '%s'\n"), TempPath); } RetVal = -1; } } } /* can rename temporary file to output file? */ if (!RetVal) { #ifdef NEED_REMOVE if (unlink(TargetFN) && (errno != ENOENT)) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, TargetFN, errstr); } RetVal = -1; } #endif if (rename(TempPath, TargetFN) == -1) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("problems renaming '%s' to '%s': %s\n"), TempPath, TargetFN, errstr); #ifdef S_ISLNK if (ResolveSymlinkResult > 0) fprintf(stderr, _(" which is the target of symbolic link '%s'\n"), ipOutFN); #endif fprintf(stderr, _(" output file remains in '%s'\n"), TempPath); } RetVal = -1; } if (ResolveSymlinkResult > 0) free(TargetFN); } free(TempPath); return RetVal; } /* convert stdin to UNIX format text and write to stdout * RetVal: 0 if success * -1 otherwise */ int ConvertDosToUnixStdio(CFlag *ipFlag, char *progname) { ipFlag->NewFile = 1; ipFlag->Quiet = 1; ipFlag->KeepDate = 0; ipFlag->Force = 1; #if defined(_WIN32) && !defined(__CYGWIN__) /* stdin and stdout are by default text streams. We need * to set them to binary mode. Otherwise an LF will * automatically be converted to CR-LF on DOS/Windows. * Erwin */ /* POSIX 'setmode' was deprecated by MicroSoft since * Visual C++ 2005. Use ISO C++ conformant '_setmode' instead. */ _setmode(_fileno(stdout), _O_BINARY); _setmode(_fileno(stdin), _O_BINARY); #elif defined(__MSDOS__) || defined(__CYGWIN__) || defined(__OS2__) setmode(fileno(stdout), O_BINARY); setmode(fileno(stdin), O_BINARY); #endif read_bom(stdin, &ipFlag->bomtype); #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16LE)) ipFlag->bomtype = FILE_UTF16LE; if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16BE)) ipFlag->bomtype = FILE_UTF16BE; #endif if (ipFlag->add_bom) fprintf(stdout, "%s", "\xEF\xBB\xBF"); /* UTF-8 BOM */ #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { return (ConvertDosToUnixW(stdin, stdout, ipFlag, progname)); } else { return (ConvertDosToUnix(stdin, stdout, ipFlag, progname)); } #else return (ConvertDosToUnix(stdin, stdout, ipFlag, progname)); #endif } int main (int argc, char *argv[]) { /* variable declarations */ char progname[9]; int ArgIdx; int CanSwitchFileMode; int ShouldExit; int RetVal = 0; int process_options = 1; CFlag *pFlag; char *ptr; #ifdef ENABLE_NLS char localedir[1024]; #endif # ifdef __MINGW64__ int _dowildcard = -1; /* enable wildcard expansion for Win64 */ # endif progname[8] = '\0'; strcpy(progname,"dos2unix"); #ifdef ENABLE_NLS ptr = getenv("DOS2UNIX_LOCALEDIR"); if (ptr == NULL) strcpy(localedir,LOCALEDIR); else { if (strlen(ptr) < sizeof(localedir)) strcpy(localedir,ptr); else { fprintf(stderr,"%s: ",progname); fprintf(stderr, "%s", _("error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n")); strcpy(localedir,LOCALEDIR); } } #endif #if defined(ENABLE_NLS) || (defined(D2U_UNICODE) && !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__)) /* setlocale() is also needed for nl_langinfo() */ setlocale (LC_ALL, ""); #endif #ifdef ENABLE_NLS bindtextdomain (PACKAGE, localedir); textdomain (PACKAGE); #endif /* variable initialisations */ ArgIdx = 0; CanSwitchFileMode = 1; ShouldExit = 0; pFlag = (CFlag*)malloc(sizeof(CFlag)); pFlag->NewFile = 0; pFlag->Quiet = 0; pFlag->KeepDate = 0; pFlag->ConvMode = CONVMODE_ASCII; /* default ascii */ pFlag->FromToMode = FROMTO_DOS2UNIX; /* default dos2unix */ pFlag->NewLine = 0; pFlag->Force = 0; pFlag->Follow = SYMLINK_SKIP; pFlag->status = 0; pFlag->stdio_mode = 1; pFlag->error = 0; #ifdef D2U_UNICODE pFlag->bomtype = FILE_MBS; #endif pFlag->add_bom = 0; if ( ((ptr=strrchr(argv[0],'/')) == NULL) && ((ptr=strrchr(argv[0],'\\')) == NULL) ) ptr = argv[0]; else ptr++; if ((strcmpi("mac2unix", ptr) == 0) || (strcmpi("mac2unix.exe", ptr) == 0)) { pFlag->FromToMode = FROMTO_MAC2UNIX; strcpy(progname,"mac2unix"); } while ((++ArgIdx < argc) && (!ShouldExit)) { /* is it an option? */ if ((argv[ArgIdx][0] == '-') && process_options) { /* an option */ if (strcmp(argv[ArgIdx],"--") == 0) process_options = 0; else if ((strcmp(argv[ArgIdx],"-h") == 0) || (strcmp(argv[ArgIdx],"--help") == 0)) { PrintUsage(progname); return(pFlag->error); } else if ((strcmp(argv[ArgIdx],"-k") == 0) || (strcmp(argv[ArgIdx],"--keepdate") == 0)) pFlag->KeepDate = 1; else if ((strcmp(argv[ArgIdx],"-f") == 0) || (strcmp(argv[ArgIdx],"--force") == 0)) pFlag->Force = 1; else if ((strcmp(argv[ArgIdx],"-s") == 0) || (strcmp(argv[ArgIdx],"--safe") == 0)) pFlag->Force = 0; else if ((strcmp(argv[ArgIdx],"-q") == 0) || (strcmp(argv[ArgIdx],"--quiet") == 0)) pFlag->Quiet = 1; else if ((strcmp(argv[ArgIdx],"-l") == 0) || (strcmp(argv[ArgIdx],"--newline") == 0)) pFlag->NewLine = 1; else if ((strcmp(argv[ArgIdx],"-m") == 0) || (strcmp(argv[ArgIdx],"--add-bom") == 0)) pFlag->add_bom = 1; else if ((strcmp(argv[ArgIdx],"-S") == 0) || (strcmp(argv[ArgIdx],"--skip-symlink") == 0)) pFlag->Follow = SYMLINK_SKIP; else if ((strcmp(argv[ArgIdx],"-F") == 0) || (strcmp(argv[ArgIdx],"--follow-symlink") == 0)) pFlag->Follow = SYMLINK_FOLLOW; else if ((strcmp(argv[ArgIdx],"-R") == 0) || (strcmp(argv[ArgIdx],"--replace-symlink") == 0)) pFlag->Follow = SYMLINK_REPLACE; else if ((strcmp(argv[ArgIdx],"-V") == 0) || (strcmp(argv[ArgIdx],"--version") == 0)) { PrintVersion(progname); #ifdef ENABLE_NLS PrintLocaledir(localedir); #endif return(pFlag->error); } else if ((strcmp(argv[ArgIdx],"-L") == 0) || (strcmp(argv[ArgIdx],"--license") == 0)) { PrintLicense(); return(pFlag->error); } else if (strcmp(argv[ArgIdx],"-ascii") == 0) /* SunOS compatible options */ pFlag->ConvMode = CONVMODE_ASCII; else if (strcmp(argv[ArgIdx],"-7") == 0) pFlag->ConvMode = CONVMODE_7BIT; else if (strcmp(argv[ArgIdx],"-iso") == 0) { pFlag->ConvMode = (int)query_con_codepage(); if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr,_("active code page: %d\n"), pFlag->ConvMode); } if (pFlag->ConvMode < 2) pFlag->ConvMode = CONVMODE_437; } else if (strcmp(argv[ArgIdx],"-437") == 0) pFlag->ConvMode = CONVMODE_437; else if (strcmp(argv[ArgIdx],"-850") == 0) pFlag->ConvMode = CONVMODE_850; else if (strcmp(argv[ArgIdx],"-860") == 0) pFlag->ConvMode = CONVMODE_860; else if (strcmp(argv[ArgIdx],"-863") == 0) pFlag->ConvMode = CONVMODE_863; else if (strcmp(argv[ArgIdx],"-865") == 0) pFlag->ConvMode = CONVMODE_865; else if (strcmp(argv[ArgIdx],"-1252") == 0) pFlag->ConvMode = CONVMODE_1252; #ifdef D2U_UNICODE else if ((strcmp(argv[ArgIdx],"-ul") == 0) || (strcmp(argv[ArgIdx],"--assume-utf16le") == 0)) pFlag->ConvMode = CONVMODE_UTF16LE; else if ((strcmp(argv[ArgIdx],"-ub") == 0) || (strcmp(argv[ArgIdx],"--assume-utf16be") == 0)) pFlag->ConvMode = CONVMODE_UTF16BE; #endif else if ((strcmp(argv[ArgIdx],"-c") == 0) || (strcmp(argv[ArgIdx],"--convmode") == 0)) { if (++ArgIdx < argc) { if (strcmpi(argv[ArgIdx],"ascii") == 0) /* Benjamin Lin's legacy options */ pFlag->ConvMode = CONVMODE_ASCII; else if (strcmpi(argv[ArgIdx], "7bit") == 0) pFlag->ConvMode = CONVMODE_7BIT; else if (strcmpi(argv[ArgIdx], "iso") == 0) { pFlag->ConvMode = (int)query_con_codepage(); if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr,_("active code page: %d\n"), pFlag->ConvMode); } if (pFlag->ConvMode < 2) pFlag->ConvMode = CONVMODE_437; } else if (strcmpi(argv[ArgIdx], "mac") == 0) pFlag->FromToMode = FROMTO_MAC2UNIX; else { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("invalid %s conversion mode specified\n"),argv[ArgIdx]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } } else { ArgIdx--; fprintf(stderr,"%s: ",progname); fprintf(stderr,_("option '%s' requires an argument\n"),argv[ArgIdx]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } } else if ((strcmp(argv[ArgIdx],"-o") == 0) || (strcmp(argv[ArgIdx],"--oldfile") == 0)) { /* last convert not paired */ if (!CanSwitchFileMode) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("target of file %s not specified in new file mode\n"), argv[ArgIdx-1]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } pFlag->NewFile = 0; } else if ((strcmp(argv[ArgIdx],"-n") == 0) || (strcmp(argv[ArgIdx],"--newfile") == 0)) { /* last convert not paired */ if (!CanSwitchFileMode) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("target of file %s not specified in new file mode\n"), argv[ArgIdx-1]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } pFlag->NewFile = 1; } else { /* wrong option */ PrintUsage(progname); ShouldExit = 1; pFlag->error = 1; pFlag->stdio_mode = 0; } } else { pFlag->stdio_mode = 0; /* not an option */ if (pFlag->NewFile) { if (CanSwitchFileMode) CanSwitchFileMode = 0; else { RetVal = ConvertDosToUnixNewFile(argv[ArgIdx-1], argv[ArgIdx], pFlag, progname); if (pFlag->status & NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping %s, not a regular file.\n"), argv[ArgIdx-1]); } } else if (pFlag->status & OUTPUTFILE_SYMLINK) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping %s, output file %s is a symbolic link.\n"), argv[ArgIdx-1], argv[ArgIdx]); } } else if (pFlag->status & INPUT_TARGET_NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), argv[ArgIdx-1]); } } else if (pFlag->status & OUTPUT_TARGET_NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping %s, target of symbolic link %s is not a regular file.\n"), argv[ArgIdx-1], argv[ArgIdx]); } } else if (pFlag->status & BINARY_FILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping binary file %s\n"), argv[ArgIdx-1]); } } else if (pFlag->status & WRONG_CODEPAGE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode); } } else if (pFlag->status & LOCALE_NOT_UTF8) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n"), argv[ArgIdx-1]); } } else if (pFlag->status & WCHAR_T_TOO_SMALL) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), argv[ArgIdx-1], (int)sizeof(wchar_t)); } } else if (pFlag->status & UNICODE_CONVERSION_ERROR) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n"), argv[ArgIdx-1]); } } else { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("converting file %s to file %s in Unix format ...\n"), argv[ArgIdx-1], argv[ArgIdx]); } if (RetVal) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("problems converting file %s to file %s\n"), argv[ArgIdx-1], argv[ArgIdx]); } } } CanSwitchFileMode = 1; } } else { RetVal = ConvertDosToUnixNewFile(argv[ArgIdx], argv[ArgIdx], pFlag, progname); if (pFlag->status & NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping %s, not a regular file.\n"), argv[ArgIdx]); } } else if (pFlag->status & OUTPUTFILE_SYMLINK) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping symbolic link %s.\n"), argv[ArgIdx]); } } else if (pFlag->status & INPUT_TARGET_NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), argv[ArgIdx]); } } else if (pFlag->status & BINARY_FILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping binary file %s\n"), argv[ArgIdx]); } } else if (pFlag->status & WRONG_CODEPAGE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode); } } else if (pFlag->status & LOCALE_NOT_UTF8) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n"), argv[ArgIdx]); } } else if (pFlag->status & WCHAR_T_TOO_SMALL) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), argv[ArgIdx], (int)sizeof(wchar_t)); } } else if (pFlag->status & UNICODE_CONVERSION_ERROR) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n"), argv[ArgIdx]); } } else { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("converting file %s to Unix format ...\n"), argv[ArgIdx]); } if (RetVal) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("problems converting file %s\n"), argv[ArgIdx]); } } } } } } /* no file argument, use stdin and stdout */ if (pFlag->stdio_mode) { exit(ConvertDosToUnixStdio(pFlag, progname)); } if (!CanSwitchFileMode) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("target of file %s not specified in new file mode\n"), argv[ArgIdx-1]); pFlag->error = 1; } return (pFlag->error); } dos2unix-6.0.4/dos2unix.h0000644000175500010010000004507411756222577014517 0ustar waterlanGeen/* * Copyright (C) 2009-2012 Erwin Waterlander * Copyright (C) 1994-1995 Benjamin Lin. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice in the documentation and/or other materials provided with * the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __DOS2UNIX_H #define __DOS2UNIX_H /* ASCII mode. No conversion. */ static int D2UAsciiTable[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x80', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87', '\x88', '\x89', '\x8a', '\x8b', '\x8c', '\x8d', '\x8e', '\x8f', '\x90', '\x91', '\x92', '\x93', '\x94', '\x95', '\x96', '\x97', '\x98', '\x99', '\x9a', '\x9b', '\x9c', '\x9d', '\x9e', '\x9f', '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf', '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf', '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf', '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7', '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf', '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7', '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff', }; /* 7bit mode. */ /* All 8 bit non-ASCII characters are converted to a space (\x20) */ static int D2U7BitTable[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', }; /* CP437 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso437Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xe4', '\xe0', '\xe5', '\xe7', '\xea', '\xeb', '\xe8', '\xef', '\xee', '\xec', '\xc4', '\xc5', '\xc9', '\xe6', '\xc6', '\xf4', '\xf6', '\xf2', '\xfb', '\xf9', '\xff', '\xd6', '\xdc', '\xa2', '\xa3', '\xa5', '\x2e', '\x2e', '\xe1', '\xed', '\xf3', '\xfa', '\xf1', '\xd1', '\xaa', '\xba', '\xbf', '\x2e', '\xac', '\xbd', '\xbc', '\xa1', '\xab', '\xbb', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xdf', '\x2e', '\x2e', '\x2e', '\x2e', '\xb5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xb1', '\x2e', '\x2e', '\x2e', '\x2e', '\xf7', '\x2e', '\xb0', '\x2e', '\xb7', '\x2e', '\x2e', '\xb2', '\x2e', '\xa0', }; /* CP850 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso850Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xe4', '\xe0', '\xe5', '\xe7', '\xea', '\xeb', '\xe8', '\xef', '\xee', '\xec', '\xc4', '\xc5', '\xc9', '\xe6', '\xc6', '\xf4', '\xf6', '\xf2', '\xfb', '\xf9', '\xff', '\xd6', '\xdc', '\xf8', '\xa3', '\xd8', '\xd7', '\x2e', '\xe1', '\xed', '\xf3', '\xfa', '\xf1', '\xd1', '\xaa', '\xba', '\xbf', '\xae', '\xac', '\xbd', '\xbc', '\xa1', '\xab', '\xbb', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xc1', '\xc2', '\xc0', '\xa9', '\x2e', '\x2e', '\x2e', '\x2e', '\xa2', '\xa5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xe3', '\xc3', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa4', '\xf0', '\xd0', '\xca', '\xcb', '\xc8', '\x2e', '\xcd', '\xce', '\xcf', '\x2e', '\x2e', '\x2e', '\x2e', '\xa6', '\xcc', '\x2e', '\xd3', '\xdf', '\xd4', '\xd2', '\xf5', '\xd5', '\xb5', '\xfe', '\xde', '\xda', '\xdb', '\xd9', '\xfd', '\xdd', '\xaf', '\xb4', '\xad', '\xb1', '\x2e', '\xbe', '\xb6', '\xa7', '\xf7', '\xb8', '\xb0', '\xa8', '\xb7', '\xb9', '\xb3', '\xb2', '\x2e', '\xa0', }; /* CP860 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso860Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xe3', '\xe0', '\xc1', '\xe7', '\xea', '\xca', '\xe8', '\xcd', '\xd4', '\xec', '\xc3', '\xc2', '\xc9', '\xc0', '\xc8', '\xf4', '\xf5', '\xf2', '\xda', '\xf9', '\xcc', '\xd5', '\xdc', '\xa2', '\xa3', '\xd9', '\x2e', '\xd3', '\xe1', '\xed', '\xf3', '\xfa', '\xf1', '\xd1', '\xaa', '\xba', '\xbf', '\xd2', '\xac', '\xbd', '\xbc', '\xa1', '\xab', '\xbb', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xdf', '\x2e', '\x2e', '\x2e', '\x2e', '\xb5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xb1', '\x2e', '\x2e', '\x2e', '\x2e', '\xf7', '\x2e', '\xb0', '\x2e', '\xb7', '\x2e', '\x2e', '\xb2', '\x2e', '\xa0', }; /* CP863 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso863Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xc2', '\xe0', '\xb6', '\xe7', '\xea', '\xeb', '\xe8', '\xef', '\xee', '\x2e', '\xc0', '\xa7', '\xc9', '\xc8', '\xca', '\xf4', '\xcb', '\xcf', '\xfb', '\xf9', '\xa4', '\xd4', '\xdc', '\xa2', '\xa3', '\xd9', '\xdb', '\x2e', '\xa6', '\xb4', '\xf3', '\xfa', '\xa8', '\xb8', '\xb3', '\xaf', '\xce', '\x2e', '\xac', '\xbd', '\xbc', '\xbe', '\xab', '\xbb', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xdf', '\x2e', '\x2e', '\x2e', '\x2e', '\xb5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xb1', '\x2e', '\x2e', '\x2e', '\x2e', '\xf7', '\x2e', '\xb0', '\x2e', '\xb7', '\x2e', '\x2e', '\xb2', '\x2e', '\xa0', }; /* CP865 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso865Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xe4', '\xe0', '\xe5', '\xe7', '\xea', '\xeb', '\xe8', '\xef', '\xee', '\xec', '\xc4', '\xc5', '\xc9', '\xe6', '\xc6', '\xf4', '\xf6', '\xf2', '\xfb', '\xf9', '\xff', '\xd6', '\xdc', '\xf8', '\xa3', '\xd8', '\x2e', '\x2e', '\xe1', '\xed', '\xf3', '\xfa', '\xf1', '\xd1', '\xaa', '\xba', '\xbf', '\x2e', '\xac', '\xbd', '\xbc', '\xa1', '\xab', '\xa4', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xdf', '\x2e', '\x2e', '\x2e', '\x2e', '\xb5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xb1', '\x2e', '\x2e', '\x2e', '\x2e', '\xf7', '\x2e', '\xb0', '\x2e', '\xb7', '\x2e', '\x2e', '\xb2', '\x2e', '\xa0', }; /* CP1252 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso1252Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf', '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf', '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf', '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7', '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf', '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7', '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff', }; #endif dos2unix-6.0.4/emx.mak0000644000175500010010000000206212235307262014030 0ustar waterlanGeen # Author: Erwin Waterlander # Copyright (C) 2009-2012 Erwin Waterlander # This file is distributed under the same license as the dos2unix package. prefix=c:/usr ENABLE_NLS=1 LDFLAGS_EXTRA = -Zargs-wild ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif ZIPOBJ_EXTRA = all: $(MAKE) all EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LDFLAGS_EXTRA="$(LDFLAGS_EXTRA)" LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" EO_XNOTATION=1 UCS= MAN_NONLATIN= install: $(MAKE) install EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LDFLAGS_EXTRA="$(LDFLAGS_EXTRA)" LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" EO_XNOTATION=1 UCS= MAN_NONLATIN= uninstall: $(MAKE) uninstall EXE=.exe prefix=$(prefix) MAN_NONLATIN= clean: $(MAKE) clean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) mostlyclean: $(MAKE) mostlyclean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) dist: $(MAKE) dist-zip EXE=.exe prefix=$(prefix) VERSIONSUFFIX="-os2" ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" ENABLE_NLS=$(ENABLE_NLS) strip: $(MAKE) strip LINK="cp -f" EXE=.exe dos2unix-6.0.4/INSTALL.txt0000644000175500010010000002150412260365416014421 0ustar waterlanGeenPREREQUISITES Using GCC: Required * gcc : GNU C compiler * GNU binutils : A collection of binary tools * GNU make : make * sh : POSIX type shell * GNU coreutils: Core utilities package (chmod, install, mkdir, mv, rm, uname) * perl : Practical Extraction and Report Language (perlpod) For manuals in non-Latin1 (non-Western-European) languages perl >= 5.10.1 is required. Optional (depending on build targets): * gettext : Framework to help GNU packages produce multi- lingual messages. * groff : GNU troff text formatting system. * ghostscript : An interpreter for the PostScript language and for PDF (ps2pdf) * iconv : Character set conversion utility. Using Watcom C: Required * Open Watcom : http://www.openwatcom.org/ * perl : Practical Extraction and Report Language (perlpod) http://strawberryperl.com/ Using Microsoft Visual C++: Required * Visual C++ : You can get a free express version via this web page: http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express * perl : Practical Extraction and Report Language (perlpod) http://strawberryperl.com/ BASIC INSTALLATION To build the program type: make To strip the executables: make strip To install: make install Clean: make clean Mostly clean. The target mostlyclean will preserve the generated documentation files. make mostlyclean INSTALLATION NAMES By default the 'install' target will install the program in /usr/bin, the language files in /usr/share/locale and the man page in /usr/share/man. You can specify an installation prefix other than /usr by modifying the 'prefix' variable. An Example: make prefix=$HOME clean all make prefix=$HOME install DEBUG A debug enabled build can be made by adding DEBUG=1 to the make command. Example: make clean install DEBUG=1 With debug enabled dos2unix will print extra information and you can debug the source code in gdb. NATIVE LANGUAGE SUPPORT Native Language Support (NLS) is by default enabled. To disable NLS add ENABLE_NLS=. Example: make clean install ENABLE_NLS= INTERNATIONAL MAN PAGES Man pages for Latin1 (Western European) scripts are supported on all systems. Man pages for non-Latin1 scripts are only supported on modern Unix (like) systems. This is controlled via the make variable MAN_NONLATIN. When the value of MAN_NONLATIN is equal to 1 (default for Unix) non-Latin manual pages are built. For DOS, Windows, OS/2 this variable is default empty. Enable non-Latin man pages: make install MAN_NONLATIN=1 Disable non-Latin man pages: make install MAN_NONLATIN= Generation of non-Latin1 manuals requires Perl >= 5.10.1. Originally the Unix man system supported only man pages in Latin1 format (ISO-8859-1). Although the world is moving to Unicode format (UTF-8) there is still a lot of Latin1 legacy around. The English man page is a pure ASCII file and is readable on all platforms. The non-English Latin script man pages are ASCII files and use GNU groff extension codes (see man groff_char) for the non-ASCII Latin1 characters. This way the man pages show properly in UTF-8 environments (modern Linuxes) and legacy Latin1 (DJGPP, MinGW, Cygwin, old Unixes). GNU groff is wide spread, but there are also roff implementations around that don't support the GNU extensions. Man pages for non-Latin1 scripts are encoded in UTF-8. These do not show properly on old systems. Therefore these are not built for DOS, and Windows by default. Man pages in UTF-8 format are shown properly on Linux. Not all roff implementations support UTF-8. In order to show UTF-8 man pages properly on Cygwin you need to do the following: In /etc/man.conf, change the NROFF definition to use 'preconv'. NROFF /usr/bin/preconv | /usr/bin/nroff -c -mandoc 2>/dev/null To view the man page set the correct locale. E.g. for Russian: export LANG=ru_RU.UTF-8 man dos2unix LARGE FILE SUPPORT Large File Support (LFS) is by default enabled. This enables the use of 64 bit file system interface on 32 bit systems. This makes it possible to open files larger than 2GB on 32 bit systems, provided the OS has LFS support builtin. To disable LFS make the LFS variable empty. Example: Disable LFS: make clean install LFS= The gcc compiler from the mingw.org project does not support LFS. It is advised to use the mingw-w64 compiler tool chain for LFS on 32 bit Windows. UNICODE SUPPORT Unicode UTF-16 support is by default enabled for Windows and Unix. To disable make the UCS variable (Universal Character Set) empty. Disable Unicode: make clean install UCS= Unicode UTF-16 is not supported by the DOS and OS/2 versions. ESPERANTO X-NOTATION For systems that don't support the Unicode or Latin-3 character set, Esperanto messages in ASCII x-notation format can be selected. Add EO_XNOTATION=1 to the make command-line. It will change the format of the normal dos2unix 'eo' locale from Unicode to ASCII x-notation. make clean install EO_XNOTATION=1 DOCUMENTATION Manual pages are generated from Perl POD files. The manual pages in text and html format are by default only created in English language. To create text and html manuals for other languages type: make txt make html Once the manuals in non-English languages have been created, they will also be installed under share/doc/ when you type 'make install' Creation of non-English manuals in text or html format require an installation of iconv. Manuals in PDF format are by default not created. To create manuals in PDF format type: make pdf PDF generation requires GhostScript to be installed. WINDOWS 32 BIT PORT Using Mingw compiler : make -f mingw.mak clean make -f mingw.mak make -f mingw.mak strip make -f mingw.mak install Using Mingw-w64 compiler : I used Ruben van Boxem release installed in c:\mingw32 32 bit host, 32 bit target: i686-w64-mingw32-gcc-4.6.3-2-release-win32_rubenvb.7z make -f mingw32.mak clean make -f mingw32.mak make -f mingw32.mak strip make -f mingw32.mak install Or use Open Watcom and type: wmake -f wccwin32.mak clean wmake -f wccwin32.mak wmake -f wccwin32.mak install Or use Microsoft Visual C++ and type: nmake /f vc.mak clean nmake /f vc.mak nmake /f vc.mak install The win32 binaries built with MinGW32 are packed with a patched version of MinGW's libintl-8.dll that has builtin support for relocation. See also http://waterlan.home.xs4all.nl/libintl.html and http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3003879&group_id=2435 WINDOWS 64 BIT PORT To compile a version for 64 bit Windows, get the Mingw-w64 compiler , and use makefile mingw64.mak: I used Ruben van Boxem release installed in c:\mingw64 32 bit host, 64 bit target: x86_64-w64-mingw32-gcc-4.6.3-2-release-win32_rubenvb.7z make -f mingw64.mak clean make -f mingw64.mak make -f mingw64.mak strip make -f mingw64.mak install DOS PORT, 32 BIT To compile a version for DOS, get the DJGPP compiler , and use makefile djgpp.mak: make -f djgpp.mak clean make -f djgpp.mak make -f djgpp.mak strip make -f djgpp.mak install Or use Open Watcom wmake -f wccdos32.mak clean wmake -f wccdos32.mak wmake -f wccdos32.mak install DOS PORT, 16 BIT To compile a version for DOS, use the Borland C compiler 3.1 or 4.0, and use makefile bcc.mak: make -f bcc.mak clean make -f bcc.mak Or use Open Watcom wmake -f wccdos16.mak clean wmake -f wccdos16.mak wmake -f wccdos16.mak install OS/2 PORT Using EMX make -f emx.mak clean make -f emx.mak make -f emx.mak strip make -f emx.mak install Open Watcom wmake -f wccos2.mak clean wmake -f wccos2.mak wmake -f wccos2.mak install dos2unix-6.0.4/Makefile0000644000175500010010000005043112245223471014210 0ustar waterlanGeen# Author: Erwin Waterlander # # Copyright (C) 2009-2013 Erwin Waterlander # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice in the documentation and/or other materials provided with # the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Description # # This is a GNU Makefile that uses GNU compilers, linkers and cpp. The # platform specific issues are determined by the various OS teets that # rely on the uname(1) command and directory locations. # # Set additional flags for the build with variables CFLAGS_USER, # DEFS_USER and LDFLAGS_USER. include version.mk .PHONY: man txt html pdf mofiles tags merge CC ?= gcc CPP ?= cpp CPP_FLAGS_POD = ALL STRIP = strip PACKAGE = dos2unix UNIX2DOS = unix2dos MAC2UNIX = mac2unix UNIX2MAC = unix2mac # Native Language Support (NLS) ENABLE_NLS = 1 # Large File Support (LFS) LFS = 1 DEBUG = 0 UCS = 1 # I can set MAN_NONLATIN to 1, despite the compilation issues with old Perl # versions, because I'm going to include the non-Latin1 manual files into the # source package. MAN_NONLATIN = 1 EXE= BIN = $(PACKAGE)$(EXE) UNIX2DOS_BIN = $(UNIX2DOS)$(EXE) MAC2UNIX_BIN = $(MAC2UNIX)$(EXE) UNIX2MAC_BIN = $(UNIX2MAC)$(EXE) # DJGPP support linking of .EXEs via 'stubify'. # See djgpp.mak and http://www.delorie.com/djgpp/v2faq/faq22_5.html LINK = ln -sf LINK_MAN = $(LINK) prefix = /usr exec_prefix = $(prefix) bindir = $(exec_prefix)/bin datarootdir = $(prefix)/share datadir = $(datarootdir) docsubdir = $(PACKAGE)-$(DOS2UNIX_VERSION) docdir = $(datarootdir)/doc/$(docsubdir) localedir = $(datarootdir)/locale mandir = $(datarootdir)/man man1dir = $(mandir)/man1 manext = .1 man1ext = .1 ifdef ENABLE_NLS POT = po/$(PACKAGE).pot POFILES = $(wildcard po/??.po) MOFILES = $(patsubst %.po,%.mo,$(POFILES)) EOX_POFILES = po/eo-x.po NLSSUFFIX = -nls endif HTMLEXT = htm # By default we generate only English text and html manuals. # Then we don't need "pod2text --utf8" and we have no dependency on iconv. DOCFILES = man/man1/$(PACKAGE).txt man/man1/$(PACKAGE).$(HTMLEXT) INSTALL_OBJS_DOC = README.txt INSTALL.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt $(DOCFILES) PODFILES_ALL = man/man1/dos2unix.pod $(wildcard man/*/man1/dos2unix.pod) PODFILES = $(wildcard man/*/man1/dos2unix.pod) MANFILES = $(patsubst %.pod,%.1,$(PODFILES)) TXTFILES = $(patsubst %.pod,%.txt,$(PODFILES_ALL)) HTMLFILES = $(patsubst %.pod,%.$(HTMLEXT),$(PODFILES_ALL)) PSFILES = $(patsubst %.pod,%.ps,$(PODFILES_ALL)) PDFFILES = $(patsubst %.pod,%.pdf,$(PODFILES_ALL)) UTF8FILES = $(patsubst %.pod,%.ut8,$(PODFILES_ALL)) # On some systems (e.g. FreeBSD 4.10) GNU install is installed as `ginstall'. INSTALL = install # On some systems (e.g. GNU Win32) GNU mkdir is installed as `gmkdir'. MKDIR = mkdir ifdef ENABLE_NLS DOS2UNIX_NLSDEFS = -DENABLE_NLS -DLOCALEDIR=\"$(localedir)\" -DPACKAGE=\"$(PACKAGE)\" endif VERSIONSUFFIX = -bin # ......................................................... OS flags ... D2U_OS = ifndef D2U_OS ifeq (Linux, $(shell uname -s)) D2U_OS = linux endif endif ifndef D2U_OS ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) D2U_OS = cygwin endif endif ifeq (cygwin,$(D2U_OS)) ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv endif LDFLAGS_EXTRA = -Wl,--enable-auto-import EXE = .exe # allow non-cygwin clients which do not understand cygwin # symbolic links to launch applications... LINK = ln -f # but use symbolic links for man pages, since man client # IS a cygwin app and DOES understand symlinks. LINK_MAN = ln -fs # Cygwin packaging standard avoids version numbers on # documentation directories. docsubdir = $(PACKAGE) VERSIONSUFFIX = -cygwin MAN_NONLATIN = 1 endif ifndef D2U_OS ifeq ($(findstring MSYS,$(shell uname)),MSYS) CC=gcc D2U_OS = msys EXE = .exe VERSIONSUFFIX = -msys EO_XNOTATION=1 UCS = MAN_NONLATIN = ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv endif endif endif ifndef D2U_OS ifeq ($(findstring MINGW32,$(shell uname)),MINGW32) D2U_OS = mingw32 prefix=c:/usr/local EXE = .exe VERSIONSUFFIX = -win32 LINK = cp -f EO_XNOTATION=1 MAN_NONLATIN = ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll endif ifeq ($(findstring w64-mingw32,$(shell gcc -dumpmachine)),w64-mingw32) CFLAGS_COMPILER = -DD2U_COMPILER=MINGW32_W64 endif endif endif ifndef D2U_OS ifneq ($(DJGPP),) D2U_OS = msdos prefix=c:/dos32 EXE = .exe VERSIONSUFFIX = pm LINK_MAN = cp -f docsubdir = dos2unix EO_XNOTATION=1 UCS = MAN_NONLATIN = ZIPOBJ_EXTRA = bin/cwsdpmi.exe ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv endif endif endif ifndef D2U_OS ifeq ($(shell uname),OS/2) D2U_OS = os/2 prefix=c:/usr EXE = .exe VERSIONSUFFIX = -os2 LINK_MAN = cp -f EO_XNOTATION=1 UCS = MAN_NONLATIN = LDFLAGS_EXTRA = -Zargs-wild ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif endif endif ifndef D2U_OS ifeq (FreeBSD, $(shell uname -s)) D2U_OS = freebsd ifdef ENABLE_NLS CFLAGS_OS = -I/usr/local/include LDFLAGS_EXTRA = -L/usr/local/lib LIBS_EXTRA = -lintl endif endif endif ifeq (Darwin, $(shell uname -s)) D2U_OS = Darwin ifdef ENABLE_NLS CFLAGS_OS = -I/usr/local/include LDFLAGS_EXTRA = -L/usr/local/lib LIBS_EXTRA = -lintl endif endif ifndef D2U_OS ifneq (, $(wildcard /opt/csw)) D2U_OS = sun endif endif ifeq (sun,$(D2U_OS)) # Running under SunOS/Solaris LIBS_EXTRA = -lintl endif ifndef D2U_OS ifeq (HP-UX, $(shell uname -s)) D2U_OS = hpux endif endif ifeq (hpux,$(D2U_OS)) # Running under HP-UX EXTRA_DEFS += -Dhpux -D_HPUX_SOURCE endif ifndef D2U_OS D2U_OS = $(shell uname -s) endif # ............................................................ flags ... # For systems that don't support Unicode or Latin-3, select # Esperanto in X-notation format: EO_XNOTATION=1 ifdef EO_XNOTATION EO_NOTATION = -x endif ifeq ($(MAN_NONLATIN),1) PODFILES_NONLATIN = $(wildcard man/nonlatin/*/man1/dos2unix.pod) MANFILES_NONLATIN = $(patsubst %.pod,%.1,$(PODFILES_NONLATIN)) TXTFILES_NONLATIN = $(patsubst %.pod,%.txt,$(PODFILES_NONLATIN)) HTMLFILES_NONLATIN = $(patsubst %.pod,%.$(HTMLEXT),$(PODFILES_NONLATIN)) # PostScript and PDF generation from UTF-8 manuals is not working, # or I don't know how to do it. #PSFILES_NONLATIN = $(patsubst %.pod,%.ps,$(PODFILES_NONLATIN)) #PDFFILES_NONLATIN = $(patsubst %.pod,%.pdf,$(PODFILES_NONLATIN)) endif CFLAGS_USER = CFLAGS ?= -O2 CFLAGS += -Wall $(RPM_OPT_FLAGS) $(CPPFLAGS) $(CFLAGS_USER) EXTRA_CFLAGS = -DVER_REVISION=\"$(DOS2UNIX_VERSION)\" \ -DVER_DATE=\"$(DOS2UNIX_DATE)\" \ -DVER_AUTHOR=\"$(DOS2UNIX_AUTHOR)\" \ -DDEBUG=$(DEBUG) \ $(CFLAGS_OS) \ $(CFLAGS_COMPILER) ifeq ($(DEBUG), 1) EXTRA_CFLAGS += -g endif ifdef STATIC EXTRA_CFLAGS += -static endif ifdef UCS EXTRA_CFLAGS += -DD2U_UNICODE endif ifdef LFS EXTRA_CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 endif LDFLAGS_USER = LDFLAGS = $(RPM_OPT_FLAGS) $(LDFLAGS_EXTRA) $(LDFLAGS_USER) LIBS = $(LIBS_EXTRA) DEFS_USER = DEFS = $(EXTRA_DEFS) $(DEFS_USER) # .......................................................... targets ... all: $(BIN) $(MAC2UNIX_BIN) $(UNIX2DOS_BIN) $(UNIX2MAC_BIN) $(DOCFILES) $(MOFILES) $(EOX_POFILES) man/man1/dos2unix.1 $(MANFILES) $(MANFILES_NONLATIN) status: @echo "D2U_OS = $(D2U_OS)" @echo "UCS = $(UCS)" @echo "CFLAGS = $(CFLAGS)" @echo "EXTRA_CFLAGS = $(EXTRA_CFLAGS)" @echo "LDFLAGS = $(LDFLAGS)" @echo "LIBS = $(LIBS)" common.o : common.c common.h $(CC) $(DEFS) $(EXTRA_CFLAGS) $(DOS2UNIX_NLSDEFS) $(CFLAGS) -c $< -o $@ querycp.o : querycp.c querycp.h $(CC) $(DEFS) $(EXTRA_CFLAGS) $(DOS2UNIX_NLSDEFS) $(CFLAGS) -c $< -o $@ dos2unix.o : dos2unix.c dos2unix.h querycp.h common.h version.mk $(CC) $(DEFS) $(EXTRA_CFLAGS) $(DOS2UNIX_NLSDEFS) $(CFLAGS) -c $< -o $@ unix2dos.o : unix2dos.c unix2dos.h querycp.h common.h version.mk $(CC) $(DEFS) $(EXTRA_CFLAGS) $(DOS2UNIX_NLSDEFS) $(CFLAGS) -c $< -o $@ $(BIN): dos2unix.o querycp.o common.o $(CC) $+ $(LDFLAGS) $(LIBS) -o $@ $(UNIX2DOS_BIN): unix2dos.o querycp.o common.o $(CC) $+ $(LDFLAGS) $(LIBS) -o $@ $(MAC2UNIX_BIN) : $(BIN) $(LINK) $< $@ %.1 : %.pod $(MAKE) -C man/man1 MAN_NONLATIN=$(MAN_NONLATIN) $(UNIX2MAC_BIN) : $(UNIX2DOS_BIN) $(LINK) $< $@ mofiles: $(MOFILES) html: $(HTMLFILES) $(HTMLFILES_NONLATIN) txt: $(TXTFILES) $(TXTFILES_NONLATIN) ps: $(PSFILES) $(PSFILES_NONLATIN) pdf: $(PDFFILES) $(PDFFILES_NONLATIN) man: man/man1/dos2unix.1 $(MANFILES) $(MANFILES_NONLATIN) doc: $(DOCFILES) tags: $(POT) merge: $(POFILES) $(EOX_POFILES) po/%.po : $(POT) msgmerge -U $@ $(POT) --backup=numbered # change timestamp in case .po file was not updated. touch $@ %.mo : %.po msgfmt -c $< -o $@ po/eo.mo : po/eo$(EO_NOTATION).po msgfmt -c $< -o $@ $(POT) : dos2unix.c unix2dos.c common.c xgettext -C --keyword=_ $+ -o $(POT) # Convert text files to UTF-8. Notepad has no problem with UTF-8. # Use iconv to convert to UTF-8. There are many old pod2text versions # around that don't have the --utf8 option yet. %.tx1 : %.pod pod2text $< > $@ %.txt : %.tx1 iconv -f ISO-8859-1 -t UTF-8 $< > $@ # Create the English txt manual straight from the .pod file. It contains only ASCII. # This saves a dependency on iconv. man/man1/$(PACKAGE).txt : man/man1/$(PACKAGE).pod pod2text $< > $@ # Non-Latin1 script manuals are already in UTF-8 format. man/nonlatin/ru/man1/$(PACKAGE).txt : man/nonlatin/ru/man1/$(PACKAGE).pod pod2text $< > $@ %.ps : %.1 groff -man $< -T ps > $@ %.pdf: %.ps ps2pdf $< $@ # The POD files are encoded in Latin-1. See also man/man1/Makefile # For non-English HTML it is best to use UTF-8. %.ut8 : %.pod iconv -f ISO-8859-1 -t UTF-8 $< > $@ # Generic rule. %.$(HTMLEXT) : %.ut8 pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/MAC to UNIX and vice versa text file format converter" $< > $@ # Create the English html manual straight from the .pod file. It contains only ASCII. # This saves a dependency on iconv. man/man1/$(PACKAGE).$(HTMLEXT) : man/man1/$(PACKAGE).pod pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/MAC to UNIX and vice versa text file format converter" $< > $@ man/nl/man1/$(PACKAGE).$(HTMLEXT) : man/nl/man1/$(PACKAGE).ut8 pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/Mac naar Unix en vice versa tekstbestand formaat omzetter" $< > $@ man/es/man1/$(PACKAGE).$(HTMLEXT) : man/es/man1/$(PACKAGE).ut8 pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa" $< > $@ man/nonlatin/ru/man1/$(PACKAGE).$(HTMLEXT) : man/nonlatin/ru/man1/$(PACKAGE).pod pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/MAC to UNIX and vice versa text file format converter" $< > $@ install: all $(MKDIR) -p -m 755 $(DESTDIR)$(bindir) $(INSTALL) -m 755 $(BIN) $(DESTDIR)$(bindir) $(INSTALL) -m 755 $(UNIX2DOS_BIN) $(DESTDIR)$(bindir) ifeq ($(LINK),cp -f) $(INSTALL) -m 755 $(MAC2UNIX_BIN) $(DESTDIR)$(bindir) $(INSTALL) -m 755 $(UNIX2MAC_BIN) $(DESTDIR)$(bindir) else cd $(DESTDIR)$(bindir); $(LINK) $(BIN) $(MAC2UNIX_BIN) cd $(DESTDIR)$(bindir); $(LINK) $(UNIX2DOS_BIN) $(UNIX2MAC_BIN) endif $(MKDIR) -p -m 755 $(DESTDIR)$(man1dir) $(INSTALL) -m 644 man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir) ifeq ($(LINK_MAN),cp -f) $(INSTALL) -m 644 man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir)/$(MAC2UNIX).1 $(INSTALL) -m 644 man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir)/$(UNIX2DOS).1 $(INSTALL) -m 644 man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir)/$(UNIX2MAC).1 else cd $(DESTDIR)$(man1dir); $(LINK_MAN) $(PACKAGE).1 $(MAC2UNIX).1 cd $(DESTDIR)$(man1dir); $(LINK_MAN) $(PACKAGE).1 $(UNIX2DOS).1 cd $(DESTDIR)$(man1dir); $(LINK_MAN) $(PACKAGE).1 $(UNIX2MAC).1 endif $(foreach manfile, $(MANFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ;) $(foreach manfile, $(MANFILES), $(INSTALL) -m 644 $(manfile) $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ;) $(foreach manfile, $(MANFILES), cd $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ; $(LINK_MAN) $(PACKAGE).1 $(MAC2UNIX).1 ;) $(foreach manfile, $(MANFILES), cd $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ; $(LINK_MAN) $(PACKAGE).1 $(UNIX2DOS).1 ;) $(foreach manfile, $(MANFILES), cd $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ; $(LINK_MAN) $(PACKAGE).1 $(UNIX2MAC).1 ;) $(foreach manfile, $(MANFILES_NONLATIN), $(MKDIR) -p -m 755 $(DESTDIR)$(datarootdir)/$(subst nonlatin/,,$(dir $(manfile))) ;) $(foreach manfile, $(MANFILES_NONLATIN), $(INSTALL) -m 644 $(manfile) $(DESTDIR)$(datarootdir)/$(subst nonlatin/,,$(dir $(manfile))) ;) $(foreach manfile, $(MANFILES_NONLATIN), cd $(DESTDIR)$(datarootdir)/$(subst nonlatin/,,$(dir $(manfile))) ; $(LINK_MAN) $(PACKAGE).1 $(MAC2UNIX).1 ;) $(foreach manfile, $(MANFILES_NONLATIN), cd $(DESTDIR)$(datarootdir)/$(subst nonlatin/,,$(dir $(manfile))) ; $(LINK_MAN) $(PACKAGE).1 $(UNIX2DOS).1 ;) $(foreach manfile, $(MANFILES_NONLATIN), cd $(DESTDIR)$(datarootdir)/$(subst nonlatin/,,$(dir $(manfile))) ; $(LINK_MAN) $(PACKAGE).1 $(UNIX2MAC).1 ;) ifdef ENABLE_NLS @echo "-- install-mo" $(foreach mofile, $(MOFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES ;) $(foreach mofile, $(MOFILES), $(INSTALL) -m 644 $(mofile) $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;) endif # Run a new instance of 'make' otherwise the $$(wildcard ) function my not have been expanded, # because the files may not have been there when make was started. $(MAKE) install-doc install-doc: $(INSTALL_OBJS_DOC) @echo "-- install-doc" $(MKDIR) -p -m 755 $(DESTDIR)$(docdir) $(INSTALL) -m 644 $(INSTALL_OBJS_DOC) $(DESTDIR)$(docdir) # Install translated manuals when they have been generated. $(foreach txtfile, $(wildcard man/*/man1/*.txt), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;) $(foreach txtfile, $(wildcard man/*/man1/*.txt), $(INSTALL) -m 644 $(txtfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;) $(foreach htmlfile, $(wildcard man/*/man1/*.$(HTMLEXT)), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;) $(foreach htmlfile, $(wildcard man/*/man1/*.$(HTMLEXT)), $(INSTALL) -m 644 $(htmlfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;) $(foreach pdffile, $(wildcard man/*/man1/*.pdf), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(pdffile),)) ;) $(foreach pdffile, $(wildcard man/*/man1/*.pdf), $(INSTALL) -m 644 $(pdffile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(pdffile),)) ;) $(foreach pdffile, $(wildcard man/man1/*.pdf), $(INSTALL) -m 644 $(pdffile) $(DESTDIR)$(docdir) ;) $(foreach psfile, $(wildcard man/*/man1/*.ps), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(psfile),)) ;) $(foreach psfile, $(wildcard man/*/man1/*.ps), $(INSTALL) -m 644 $(psfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(psfile),)) ;) $(foreach psfile, $(wildcard man/man1/*.ps), $(INSTALL) -m 644 $(psfile) $(DESTDIR)$(docdir) ;) $(foreach txtfile, $(wildcard man/nonlatin/*/man1/*.txt), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 3,$(subst /, ,$(txtfile),)) ;) $(foreach txtfile, $(wildcard man/nonlatin/*/man1/*.txt), $(INSTALL) -m 644 $(txtfile) $(DESTDIR)$(docdir)/$(word 3,$(subst /, ,$(txtfile),)) ;) $(foreach htmlfile, $(wildcard man/nonlatin/*/man1/*.$(HTMLEXT)), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 3,$(subst /, ,$(htmlfile),)) ;) $(foreach htmlfile, $(wildcard man/nonlatin/*/man1/*.$(HTMLEXT)), $(INSTALL) -m 644 $(htmlfile) $(DESTDIR)$(docdir)/$(word 3,$(subst /, ,$(htmlfile),)) ;) uninstall: @echo "-- target: uninstall" -rm -f $(DESTDIR)$(bindir)/$(BIN) -rm -f $(DESTDIR)$(bindir)/$(MAC2UNIX_BIN) -rm -f $(DESTDIR)$(bindir)/$(UNIX2DOS_BIN) -rm -f $(DESTDIR)$(bindir)/$(UNIX2MAC_BIN) ifdef ENABLE_NLS $(foreach mofile, $(MOFILES), rm -f $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;) endif -rm -f $(DESTDIR)$(mandir)/man1/$(PACKAGE).1 -rm -f $(DESTDIR)$(mandir)/man1/$(MAC2UNIX).1 -rm -f $(DESTDIR)$(mandir)/man1/$(UNIX2DOS).1 -rm -f $(DESTDIR)$(mandir)/man1/$(UNIX2MAC).1 $(foreach manfile, $(MANFILES), rm -f $(DESTDIR)$(datarootdir)/$(manfile) ;) $(foreach manfile, $(MANFILES_NONLATIN), rm -f $(DESTDIR)$(datarootdir)/$(subst nonlatin/,,$(manfile)) ;) -rm -rf $(DESTDIR)$(docdir) mostlyclean: rm -f *.o rm -f $(BIN) $(UNIX2DOS_BIN) $(MAC2UNIX_BIN) $(UNIX2MAC_BIN) rm -f *.bak *~ rm -f *.tmp rm -f man/man1/*.bak man/man1/*~ rm -f man/*/man1/*.bak man/*/man1/*~ rm -f po/*.bak po/*~ rm -f po/*.mo clean: mostlyclean rm -f man/man1/*.1 rm -f man/man1/*.txt rm -f man/man1/*.$(HTMLEXT) rm -f man/man1/*.ps rm -f man/man1/*.pdf rm -f man/man1/*.ut8 rm -f man/*/man1/*.1 rm -f man/*/man1/*.txt rm -f man/*/man1/*.$(HTMLEXT) rm -f man/*/man1/*.ps rm -f man/*/man1/*.pdf rm -f man/*/man1/*.ut8 rm -f man/nonlatin/*/man1/*.ps rm -f man/nonlatin/*/man1/*.pdf distclean: clean # Because there is so much trouble with generating non-Latin1 man pages with # pod2man, due to old Perl versions (< 5.10.1) on many systems, I include the # non-Latin1 man pages in the source tar file. # Old pod2man versions do not have the --utf8 option. Old pod2man, pod2text, # and pod2html do not support the =encoding command. maintainer-clean: distclean @echo 'This command is intended for maintainers to use; it' @echo 'deletes files that may need special tools to rebuild.' rm -f man/nonlatin/*/man1/*.txt rm -f man/nonlatin/*/man1/*.$(HTMLEXT) rm -f man/nonlatin/*/man1/*.1 realclean: maintainer-clean ZIPOBJ = bin/$(BIN) \ bin/$(MAC2UNIX_BIN) \ bin/$(UNIX2DOS_BIN) \ bin/$(UNIX2MAC_BIN) \ share/man/man1/$(PACKAGE).1 \ share/man/man1/$(MAC2UNIX).1 \ share/man/man1/$(UNIX2DOS).1 \ share/man/man1/$(UNIX2MAC).1 \ share/man/*/man1/$(PACKAGE).1 \ share/man/*/man1/$(MAC2UNIX).1 \ share/man/*/man1/$(UNIX2DOS).1 \ share/man/*/man1/$(UNIX2MAC).1 \ share/doc/$(docsubdir) \ $(ZIPOBJ_EXTRA) ifdef ENABLE_NLS ZIPOBJ += share/locale/*/LC_MESSAGES/$(PACKAGE).mo endif ZIPFILE = $(PACKAGE)-$(DOS2UNIX_VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX).zip TGZFILE = $(PACKAGE)-$(DOS2UNIX_VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX).tar.gz TBZFILE = $(PACKAGE)-$(DOS2UNIX_VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX).tar.bz2 dist-zip: rm -f $(prefix)/$(ZIPFILE) cd $(prefix) ; unix2dos share/man/man1/*.1 share/man/*/man1/*.1 -cd $(prefix) ; unix2dos share/doc/$(docsubdir)/*.txt share/doc/$(docsubdir)/*/*.txt -cd $(prefix) ; unix2dos share/doc/$(docsubdir)/*.$(HTMLEXT) share/doc/$(docsubdir)/*/*.$(HTMLEXT) cd $(prefix) ; unix2dos share/man/*/man1/$(PACKAGE).1 share/man/*/man1/$(MAC2UNIX).1 share/man/*/man1/$(UNIX2DOS).1 share/man/*/man1/$(UNIX2MAC).1 cd $(prefix) ; zip -r $(ZIPFILE) $(ZIPOBJ) mv -f $(prefix)/$(ZIPFILE) .. dist-tgz: cd $(prefix) ; dos2unix share/man/man1/*.1 share/man/*/man1/*.1 -cd $(prefix) ; dos2unix share/doc/$(docsubdir)/*.txt share/doc/$(docsubdir)/*/*.txt -cd $(prefix) ; dos2unix share/doc/$(docsubdir)/*.$(HTMLEXT) share/doc/$(docsubdir)/*/*.$(HTMLEXT) cd $(prefix) ; tar cvzf $(TGZFILE) $(ZIPOBJ) mv $(prefix)/$(TGZFILE) .. dist-tbz: cd $(prefix) ; dos2unix share/man/man1/*.1 share/man/*/man1/*.1 -cd $(prefix) ; dos2unix share/doc/$(docsubdir)/*.txt dos2unix share/doc/$(docsubdir)/*/*.txt -cd $(prefix) ; dos2unix share/doc/$(docsubdir)/*.$(HTMLEXT) dos2unix share/doc/$(docsubdir)/*/*.$(HTMLEXT) cd $(prefix) ; tar cvjf $(TBZFILE) $(ZIPOBJ) mv $(prefix)/$(TBZFILE) .. dist: dist-tgz strip: $(STRIP) $(BIN) $(STRIP) $(UNIX2DOS_BIN) ifeq ($(LINK),cp -f) $(STRIP) $(MAC2UNIX_BIN) $(STRIP) $(UNIX2MAC_BIN) endif # End of file dos2unix-6.0.4/man/0000755000175500010010000000000012260366761013327 5ustar waterlanGeendos2unix-6.0.4/man/es/0000755000175500010010000000000012260366761013736 5ustar waterlanGeendos2unix-6.0.4/man/es/man1/0000755000175500010010000000000012260366776014600 5ustar waterlanGeendos2unix-6.0.4/man/es/man1/dos2unix.pod0000755000175500010010000004674012175006214017054 0ustar waterlanGeen/* # # Spanish tranlation by: Julio A. Freyre-Gonzalez 2011, 2012 # # Copyright and License # # Copyright (C) 2009-2013 Erwin Waterlander # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice in the documentation and/or other materials provided with # the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Descripcin # # Para saber cual seccin de NIVEL SUPERIOR usar en las pginas del manual, # vase el estndar POSIX/Susv y "Utility Description Defaults" en # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag_01_11 # # ste es el manual en formato POD de Perl. Lase ms en # http://perldoc.perl.org/perlpod.html o ejecute el comando: # # perldoc perlpod | less # # Para revisar la sintaxis: # # podchecker *.pod # # Cree el manual con el comando: # # pod2man PAGE.N.pod > PAGE.N */ =pod =head1 NOMBRE dos2unix - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa =head1 SINOPSIS dos2unix [parmetros] [ARCHIVO ...] [-n ARCH_DE_ENTRADA ARCH_DE_SALIDA ...] unix2dos [parmetros] [ARCHIVO ...] [-n ARCH_DE_ENTRADA ARCH_DE_SALIDA ...] =head1 DESCRIPCIN El paquete Dos2unix incluye las utileras C y C para convertir archivos de texto plano en formato DOS o Mac a formato Unix y viceversa. En archivos de texto DOS/Windows, un salto de lnea, tambin conocido como nueva lnea, es una combinacin de dos caracteres: un retorno de carro (CR) seguido por un salto de lnea (LF). En archivos de texto Unix, un salto de lnea es solamente un carcter: el salto de lnea (LF). En archivos de texto Mac, antes de Mac OS X, un salto de lnea era slo un carcter retorno de carro (CR). Actualmente, Mac OS usa el estilo Unix de saltos de lnea (LF). Adems de saltos de lnea, Dos2unix puede tambin convertir la codificacin de archivos. Unas cuantas pginas de cdigos DOS pueden ser convertidas a Unix Latin-1. Y archivos Unicode de Windows (UTF-16) pueden ser convertidos a archivos Unicode de Unix (UTF-8). Los archivos binarios son ignorados automticamente, a menos que se fuerce su conversin. Los archivos no regulares, tales como directorios y FIFO, son ignorados automticamente. Los enlaces simblicos y sus destinos no son modificados por defecto. Los enlaces simblicos pueden opcionalmente ser reemplazados, o la salida puede ser escrita al archivo destino del enlace. Los enlaces simblicos en Windows no estn soportados. Estos son siempre reemplazados, sin que se alteren sus destinos. Dos2unix fue moldeado a partir del dos2unix que existe en SunOS/Solaris y tiene modos de conversin similares. =head1 PARMETROS =over 4 =item B<--> Todos los parmetros siguientes son tratados como nombres de archivo. Use este parmetro si desea convertir archivos cuyos nombres inician con un guin. Por ejemplo para convertir un archivo llamado "-foo", use este comando: dos2unix -- -foo O en modo de archivo nuevo: dos2unix -n -- -foo out.txt =item B<-ascii> Slo convierte los salto de lnea. ste es el modo de conversin por defecto. =item B<-iso> Conversin entre el conjunto de caracteres DOS e ISO-8859-1. Vase tambin la seccin MODOS DE CONVERSIN. =item B<-1252> Usa la pgina de cdigos Windows 1252 (Europa Occidental). =item B<-437> Usa la pgina de cdigos DOS 437 (EE. UU.). Est es la pgina de cdigos usada por defecto para conversin ISO. =item B<-850> Usa la pgina de cdigos DOS 850 (Europa Occidental). =item B<-860> Usa la pgina de cdigos DOS 860 (Portugus). =item B<-863> Usa la pgina de cdigos DOS 863 (Francocanadiense). =item B<-865> Usa la pgina de cdigos DOS 865 (Nrdico). =item B<-7> Convierte caracteres de 8 bits al espacio de 7 bits. =item B<-c, --convmode CONVMODE> Establece el modo de conversin, Donde CONVMODE puede ser: I, I<7bit>, I, I siendo ascii el valor por defecto. =item B<-f, --force> Fuerza la conversin de archivos binarios. =item B<-h, --help> Despiega la ayuda y termina el programa. =item B<-k, --keepdate> Mantiene la fecha del archivo de salida igual a la del archivo de entrada. =item B<-L, --license> Muestra la licencia del programa. =item B<-l, --newline> Aade salto de lnea adicional. B: Slo los saltos de lnea DOS son cambiados por dos saltos de lnea Unix. En modo Mac slo los saltos de lnea Mac son cambiados por dos saltos de lnea Unix. B: Slo los saltos de lnea Unix son cambiados por dos saltos de lnea DOS. En modo Mac los saltos de lnea Unix son cambiados por dos saltos de lnea Mac. =item B<-m, --add-bom> Escribe una marca de orden de bytes para UTF-8 en el archivo de salida. Nunca use esta opcin cuando la codificacin de salida sea distinta de UTF-8. Vase tambin la seccin UNICODE. =item B<-n, --newfile ARCH_DE_ENTRADA ARCH_DE_SALIDA ...> Modo de archivo nuevo. Convierte el archivo ARCH_DE_ENTRADA y escribe la salida al archivo ARCH_DE_SALIDA. Los nombres de archivo deben ser dados en pares y los comodines I deben ser usados o I sus archivos. La persona que inicia la conversin en el modo de archivo nuevo (pareado) ser el propietario del archivo convertido. Los permisos de lectura/escritura del archivo nuevo sern los permisos del archivo original menos la umask(1) de la persona que ejecute la conversin. =item B<-o, --oldfile ARCHIVO ...> Modo de archivo viejo. Convierte el archivo ARCHIVO y lo sobrescribe con la salida. El programa por defecto se ejecuta en este modo. S se pueden emplear comodines. En modo de archivo antiguo (in situ), el archivo convertido obtiene el mismo propietario, grupo, y permisos de lectura/escritura que el archivo original. Lo mismo aplica cuando el archivo es convertido por otro usuario quien tiene permiso de lectura en el archivo (p.e. usuario root). La conversin ser abortada cuando no sea posible preservar los valores originales. Cambiar el propietario implicara que el propietario original ya no podr leer el archivo. Cambiar el grupo podra ser un riesgo de seguridad, ya que el archivo podra ser accesible a personas inadecuadas. La preservacin del propietario, grupo, y permisos de lectura/escritura slo est soportada bajo Unix. =item B<-q, --quiet> Modo silencioso. Suprime todas las advertencias y mensajes. El valor retornado es cero. Excepto cuando se emplean parmetros incorrectos. =item B<-s, --safe> Ignora los archivos binarios (por defecto). =item B<-ul, --assume-utf16le> Supone que el formato de archivo de entrada es UTF-16LE. Cuando existe una marca de orden de bytes (BOM) en el archivo de entrada, la BOM tiene prioridad sobre esta opcin. Cuando se hace un supuesto incorrecto (el archivo de entrada no estaba en formato UTF-16LE) y la conversin tiene xito, obtendr un archivo UTF-8 de salida con el texto errneo. La conversin errnea puede ser deshecha con iconv(1) mediante convertir el archivo UTF-8 de salida de vuelta a UTF-16LE. Esto restaurar el archivo original. El supuesto de UTF-16LE funciona como un I. Al cambiar al modo por defecto I el supuesto UTF-16LE es deshabilitado. =item B<-ub, --assume-utf16be> Supone que el formato del archivo de entrada es UTF-16BE. Esta opcin funciona igual que la opcin C<-ul>. =item B<-F, --follow-symlink> Sigue los enlaces simblicos y convierte los destinos. =item B<-R, --replace-symlink> Reemplaza los enlaces simblicos con los archivos convertidos (los archivos destino originales no se alteran). =item B<-S, --skip-symlink> No altera los enlaces simblicos ni sus destinos (por defecto). =item B<-V, --version> Despiega la informacin de la versin y termina el programa. =back =head1 MODO MAC En modo normal los saltos de lnea son convertidos de DOS a Unix y viceversa. Los saltos de lnea Mac no son convertidos. En modo Mac los saltos de lnea son convertidos de Mac a Unix y viceversa. Los saltos de lnea DOS no son modificados. Para ejecutar en modo Mac use el modificador C<-c mac> o use los comandos C o C. =head1 MODOS DE CONVERSIN Los modos de conversin I, I<7bit>, e I son similares a los de los comandos dos2unix/unix2dos de SunOS/Solaris. =over 4 =item B En modo C slo los saltos de lnea son convertidos. ste es el modo de conversin por defecto. Aunque el nombre de este modo es ASCII, el cual es un estndar de 7 bits, ste emplea 8 bits. Siempre use este modo cuando convierta archivos en Unicode UTF-8. =item B<7bit> En este modo todos los caracteres no ASCII de 8 bits (con valores de 128 a 255) son convertidos al espacio de 7 bits. =item B Los caracteres son convertidos entre un conjunto de caracteres DOS (pgina de cdigos) y el conjunto de caracteres ISO-8859-1 (Latn-1) de Unix. Los caracteres DOS sin equivalente ISO-8859-1, para los cuales la conversin es imposible, son convertidos en un punto. Lo mismo se aplica para caracteres ISO-8859-1 sin contraparte DOS. Cuando slo se emplea el parmetro C<-iso>, dos2unix intentar determinar la pgina de cdigos activa. Cuando esto no sea posible, dos2unix utilizar la pgina de cdigos 437 por defecto, la cual es empleada principalmente en EE. UU. Para forzar una pgina de cdigos especfica emplee los parmetros C<-437> (EE. UU.), C<-850> (Europa Occidental), C<-860> (Portugus), C<-863> (Francocanadiense), o C<-865> (Nrdico). La pgina de cdigos Windows 1252 (Europa Occidental) tambin est soportada con el parmetro C<-1252>. Para acceder a otras pginas de cdigos use dos2unix en combinacin con iconv(1). Iconv puede convertir entre una larga lista de codificaciones de caracteres. Nunca emplee la conversin ISO en archivos de texto Unicode. Esto corromper los archivos codificados como UTF-8. Algunos ejemplos: Convierte de la pgina de cdigos por defecto de DOS a Latn-1 de Unix. dos2unix -iso -n in.txt out.txt Convierte de DOS 850 a Unix Latn-1. dos2unix -850 -n in.txt out.txt Convierte de Windows 1252 a Unix Latn-1. dos2unix -1252 -n in.txt out.txt Convierte de Windows 1252 a Unix UTF-8 (Unicode). iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Convierte de Unix Latn-1 a la pgina de cdigos por defecto de DOS. unix2dos -iso -n in.txt out.txt Convierte de Unix Latn-1 a DOS 850. unix2dos -850 -n in.txt out.txt Convierte de Unix Latn-1 a Windows 1252. unix2dos -1252 -n in.txt out.txt Convierte de Unix UTF-8 (Unicode) a Windows 1252. unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt Vase tambin L y L. =back =head1 UNICODE =head2 Codificaciones Existen diferentes codificaciones Unicode. En Unix y Linux los archivos Unicode son codificados comnmente como UTF-8. En Windows los archivos de texto Unicode pueden estar codificados en UTF-8, UTF-16, o UTF-16 big endian, pero con ms frecuencia son codificados en formato UTF-16. =head2 Conversion Los archivos de texto Unicode pueden tener saltos de lnea DOS, Unix o Mac, como cualquier archivo de texto. Todas las versiones de dos2unix y unix2dos pueden convertir archivos codificados como UTF-8, debido a que UTF-8 fue diseado para retro-compatibilidad con ASCII. Dos2unix y unix2dos con soporte Unicode UTF-16, pueden leer archivos de texto codificados como UTF-16 little y big endian. Para ver si dos2unix fue compilado con soporte UTF-16 escriba C. Las versiones Windows de dos2unix y unix2dos siempre convierten archivos Codificados como UTF-16 a UTF-8. Las versiones Unix de dos2unix/unix2dos convierten archivos UTF-16 a la codificacin de caracteres local cuando es configurado a UTF-8. Emplee el comando locale(1) para determinar cual es la codificacin de caracteres local. Dado que los archivos de texto formateados UTF-8 son bien soportados tanto en Windows como en Unix, dos2unix y unix2dos no tienen opcin para escribir archivos UTF-16. Todos los caracteres UTF-16 pueden ser codificados en UTF-8. La conversin de UTF-16 a UTF-8 ocurre sin prdida. Los archivos UTF-16 sern ignorados en Unix cuando la codificacin de caracteres local no sea UTF-8, para evitar la prdida accidental de texto. Cuando ocurre un error de conversin de UTF-16 a UTF-8, por ejemplo cuando el archivo de entrada UTF-16 contiene un error, el archivo ser ignorado. La conversin en modos ISO y 7-bit no funciona en archivos UTF-16. =head2 Marca de orden de bytes En Windows los archivos de texto Unicode tpicamente tienen una marca de orden de bytes (BOM), debido a que muchos programas de Windows (incluyendo el Bloc de notas) aaden una BOM por defecto. Vase tambin L. En Unix los archivos Unicode tpicamente no tienen una BOM. Se supone que los archivos de texto son codificados en la codificacin de caracteres local. Dos2unix slo puede detectar si un archivo est en formato UTF-16 si el archivo tiene una BOM. Cuando un archivo UTF-16 no tiene una BOM, dos2unix tratar el archivo como un archivo binario. Emplee la opcin C<-ul> o C<-ub> para convertir un archivo UTF-16 sin BOM. Dos2unix nunca escribe una BOM en el archivo de salida, a menos que emplee la opcin C<-m>. Unix2dos escribe una BOM en el archivo de salida cuando el archivo de entrada tiene una BOM, o cuando se emplea la opcin C<-m>. =head2 Ejemplos Unicode Convertir de Windows UTF-16 (con una BOM) a Unix UTF-8 dos2unix -n in.txt out.txt Convertir de Windows UTF-16LE (sin una BOM) a Unix UTF-8 dos2unix -ul -n in.txt out.txt Convertir de Unix UTF-8 a Windows UTF-8 sin una BOM unix2dos -m -n in.txt out.txt Convertir de Unix UTF-8 a Windows UTF-16 unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt =head1 EJEMPLOS Lee la entrada desde 'stdin' y escribe la salida a 'stdout'. dos2unix dos2unix -l -c mac Convierte y reemplaza a.txt. Convierte y reemplaza b.txt. dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convierte y reemplaza a.txt empleando modo de conversin ascii. dos2unix a.txt Convierte y reemplaza a.txt empleando modo de conversin ascii. Convierte y reemplaza b.txt empleando modo de conversin de 7bits. dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Convierte a.txt del formato de Mac a Unix. dos2unix -c mac a.txt mac2unix a.txt Convierte a.txt del formato de Unix a Mac. unix2dos -c mac a.txt unix2mac a.txt Convierte y reemplaza a.txt manteniendo la fecha del archivo original. dos2unix -k a.txt dos2unix -k -o a.txt Convierte a.txt y escribe la salida a e.txt. dos2unix -n a.txt e.txt Convierte a.txt y escribe la salida a e.txt, manteniendo la fecha de e.txt igual a la de a.txt. dos2unix -k -n a.txt e.txt Convierte y reemplaza a.txt. Convierte b.txt y escribe a e.txt. dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convierte c.txt y escribe a e.txt. Convierte y reemplaza a.txt. Convierte y reemplaza b.txt. Convierte d.txt y escribe a f.txt. dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 CONVERSIN RECURSIVA Emplee dos2unix en combinacin con los comandos find(1) y xargs(1) para convertir recursivamente archivos de texto contenidos en un rbol de directorios. Por ejemplo para convertir todos los archivos .txt en el rbol de directorios debajo del directorio actual escriba: find . -name *.txt |xargs dos2unix =head1 INTERNACIONALIZACIN =over 4 =item B El idioma principal se selecciona con la variable de entorno LANG. La variable LANG consiste de varias partes. La primer parte es el cdigo del idioma en minsculas. La segunda es opcional y es el cdigo del pas en maysculas, precedido por un guin bajo. Existe tambin una tercera parte opcional: la codificacin de caracteres, precedida por un punto. Unos cuantos ejemplos para intrpretes de comandos tipo POSIX estndar: export LANG=nl Neerlands export LANG=nl_NL Neerlands, Pases Bajos export LANG=nl_BE Neerlands, Blgica export LANG=es_ES Espaol, Espaa export LANG=es_MX Espaol, Mxico export LANG=en_US.iso88591 Ingles, EE. UU., codificacin Latn-1 export LANG=en_GB.UTF-8 Ingles, Reino Unido, codificacin UTF-8 Para una lista completa de cdigos de idioma y pas vase el manual de gettext: L En sistemas Unix puede emplear el comando locale(1) para obtener informacin especfica del locale. =item B Con la variable de entorno LANGUAGE puede especificar una lista de prioridad de los idiomas, separados por dos puntos. Dos2unix da preferencia a LANGUAGE por encima de LANG. Por ejemplo, primero neerlands y entonces alemn: C. Antes de que pueda usar una lista de prioridad de idiomas a travs de la variable LANGUAGE, primero tiene que habilitar la internacionalizacin, mediante asignar un valor distinto de "C" a LANG (o LC_ALL). Vase tambin el manual de gettext: L Si selecciona un idioma que no est disponible el programa funcionar en ingles. =item B Con la variable de entorno DOS2UNIX_LOCALEDIR el LOCALEDIR asignado durante la compilacin puede ser modificado. LOCALEDIR es usado para encontrar los archivos de idioma. El valor por defecto de GNU es C. El parmetro B<--version> desplegar el LOCALEDIR en uso. Ejemplo (intrprete de comandos POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 VALOR DE RETORNO Se regresa cero cuando el programa termina exitosamente. Cuando ocurre un error del sistema se regresar el ltimo nmero de error del sistema. Para otros errores se regresa 1. El valor de retorno es siempre cero en modo silencioso, excepto cuando se emplean parmetros incorrectos. =head1 ESTNDARES L L L L =head1 AUTORES Benjamin Lin - Bernd Johannes Wuebben (modo mac2unix) - , Christian Wurll (aadi el salto de lnea extra) - , Erwin Waterlander - (Mantenimiento) Pgina del proyecto: L Pgina de SourceForge: L Freecode: L =head1 VASE TAMBIN file(1) find(1) iconv(1) locale(1) xargs(1) =cut dos2unix-6.0.4/man/man1/0000755000175500010010000000000012260366776014171 5ustar waterlanGeendos2unix-6.0.4/man/man1/dos2unix.pod0000644000175500010010000004226512175006214016440 0ustar waterlanGeen/* # Copyright and License # # Copyright (C) 2009-2013 Erwin Waterlander # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice in the documentation and/or other materials provided with # the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Description # # To learn what TOP LEVEL section to use in manual pages, # see POSIX/Susv standard and "Utility Description Defaults" at # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag_01_11 # # This is manual page in Perl POD format. Read more at # http://perldoc.perl.org/perlpod.html or run command: # # perldoc perlpod | less # # To check the syntax: # # podchecker *.pod # # Create manual page with command: # # pod2man PAGE.N.pod > PAGE.N */ =pod =head1 NAME dos2unix - DOS/Mac to Unix and vice versa text file format converter =head1 SYNOPSIS dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...] unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...] =head1 DESCRIPTION The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa. In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks. Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files. Binary files are automatically skipped, unless conversion is forced. Non-regular files, such as directories and FIFOs, are automatically skipped. Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Symbolic links on Windows are not supported. Windows symbolic links always replaced, keeping the targets unchanged. Dos2unix was modelled after dos2unix under SunOS/Solaris and has similar conversion modes. =head1 OPTIONS =over 4 =item B<--> Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named "-foo", you can use this command: dos2unix -- -foo Or in new file mode: dos2unix -n -- -foo out.txt =item B<-ascii> Convert only line breaks. This is the default conversion mode. =item B<-iso> Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES. =item B<-1252> Use Windows code page 1252 (Western European). =item B<-437> Use DOS code page 437 (US). This is the default code page used for ISO conversion. =item B<-850> Use DOS code page 850 (Western European). =item B<-860> Use DOS code page 860 (Portuguese). =item B<-863> Use DOS code page 863 (French Canadian). =item B<-865> Use DOS code page 865 (Nordic). =item B<-7> Convert 8 bit characters to 7 bit space. =item B<-c, --convmode CONVMODE> Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default. =item B<-f, --force> Force conversion of binary files. =item B<-h, --help> Display help and exit. =item B<-k, --keepdate> Keep the date stamp of output file same as input file. =item B<-L, --license> Display program's license. =item B<-l, --newline> Add additional newline. B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks. B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks. =item B<-m, --add-bom> Write an UTF-8 Byte Order Mark in the output file. Never use this option when the output encoding is other than UTF-8. See also section UNICODE. =item B<-n, --newfile INFILE OUTFILE ...> New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files. The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion. =item B<-o, --oldfile FILE ...> Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used. In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix. =item B<-q, --quiet> Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used. =item B<-s, --safe> Skip binary files (default). =item B<-ul, --assume-utf16le> Assume that the input file format is UTF-16LE. When there is a Byte Order Mark in the input file the BOM has priority over this option. When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file. The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off. =item B<-ub, --assume-utf16be> Assume that the input file format is UTF-16BE. This option works the same as option C<-ul>. =item B<-F, --follow-symlink> Follow symbolic links and convert the targets. =item B<-R, --replace-symlink> Replace symbolic links with converted files (original target files remain unchanged). =item B<-S, --skip-symlink> Keep symbolic links and targets unchanged (default). =item B<-V, --version> Display version information and exit. =back =head1 MAC MODE In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted. In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed. To run in Mac mode use the command-line option C<-c mac> or use the commands C or C. =head1 CONVERSION MODES Conversion modes I, I<7bit>, and I are similar to those of dos2unix/unix2dos under SunOS/Solaris. =over 4 =item B In mode C only line breaks are converted. This is the default conversion mode. Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files. =item B<7bit> In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space. =item B Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart. When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings. Never use ISO converion on Unicode text files. It will corrupt UTF-8 encoded files. Some examples: Convert from DOS default code page to Unix Latin-1 dos2unix -iso -n in.txt out.txt Convert from DOS CP850 to Unix Latin-1 dos2unix -850 -n in.txt out.txt Convert from Windows CP1252 to Unix Latin-1 dos2unix -1252 -n in.txt out.txt Convert from Windows CP1252 to Unix UTF-8 (Unicode) iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Convert from Unix Latin-1 to DOS default code page. unix2dos -iso -n in.txt out.txt Convert from Unix Latin-1 to DOS CP850 unix2dos -850 -n in.txt out.txt Convert from Unix Latin-1 to Windows CP1252 unix2dos -1252 -n in.txt out.txt Convert from Unix UTF-8 (Unicode) to Windows CP1252 unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt See also L and L. =back =head1 UNICODE =head2 Encodings There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format. =head2 Conversion Unicode text files can have DOS, Unix or Mac line breaks, like regular text files. All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatiblity with ASCII. Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C. The Windows versions of dos2unix and unix2dos convert UTF-16 encoded files always to UTF-8 encoded files. Unix versions of dos2unix/unix2dos convert UTF-16 encoded files to the locale character encoding when it is set to UTF-8. Use the locale(1) command to find out what the locale character encoding is. Because UTF-8 formatted text files are well supported on both Windows and Unix, dos2unix and unix2dos have no option to write UTF-16 files. All UTF-16 characters can be encoded in UTF-8. Conversion from UTF-16 to UTF-8 is without loss. UTF-16 files will be skipped on Unix when the locale character encoding is not UTF-8, to prevent accidental loss of text. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped. ISO and 7-bit mode conversion do not work on UTF-16 files. =head2 Byte Order Mark On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L. On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding. Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file. Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM. Dos2unix never writes a BOM in the output file, unless you use option C<-m>. Unix2dos writes a BOM in the output file when the input file has a BOM, or when option C<-m> is used. =head2 Unicode examples Convert from Windows UTF-16 (with BOM) to Unix UTF-8 dos2unix -n in.txt out.txt Convert from Windows UTF-16LE (without BOM) to Unix UTF-8 dos2unix -ul -n in.txt out.txt Convert from Unix UTF-8 to Windows UTF-8 with BOM unix2dos -m -n in.txt out.txt Convert from Unix UTF-8 to Windows UTF-16 unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt =head1 EXAMPLES Read input from 'stdin' and write output to 'stdout'. dos2unix dos2unix -l -c mac Convert and replace a.txt. Convert and replace b.txt. dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convert and replace a.txt in ascii conversion mode. dos2unix a.txt Convert and replace a.txt in ascii conversion mode. Convert and replace b.txt in 7bit conversion mode. dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Convert a.txt from Mac to Unix format. dos2unix -c mac a.txt mac2unix a.txt Convert a.txt from Unix to Mac format. unix2dos -c mac a.txt unix2mac a.txt Convert and replace a.txt while keeping original date stamp. dos2unix -k a.txt dos2unix -k -o a.txt Convert a.txt and write to e.txt. dos2unix -n a.txt e.txt Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt. dos2unix -k -n a.txt e.txt Convert and replace a.txt. Convert b.txt and write to e.txt. dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convert c.txt and write to e.txt. Convert and replace a.txt. Convert and replace b.txt. Convert d.txt and write to f.txt. dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 RECURSIVE CONVERSION Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type: find . -name *.txt |xargs dos2unix =head1 LOCALIZATION =over 4 =item B The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells: export LANG=nl Dutch export LANG=nl_NL Dutch, The Netherlands export LANG=nl_BE Dutch, Belgium export LANG=es_ES Spanish, Spain export LANG=es_MX Spanish, Mexico export LANG=en_US.iso88591 English, USA, Latin-1 encoding export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding For a complete list of language and country codes see the gettext manual: L On Unix systems you can use to command locale(1) to get locale specific information. =item B With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than "C", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L If you select a language which is not available you will get the standard English messages. =item B With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used. Example (POSIX shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 RETURN VALUE On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned. The return value is always zero in quiet mode, except when wrong command-line options are used. =head1 STANDARDS L L L L =head1 AUTHORS Benjamin Lin - Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (Maintainer) Project page: L SourceForge page: L Freecode: L =head1 SEE ALSO file(1) find(1) iconv(1) locale(1) xargs(1) =cut dos2unix-6.0.4/man/man1/Makefile0000644000175500010010000001205512236256375015630 0ustar waterlanGeen# pod2man.mk -- Makefile portion to convert *.pod files to manual pages # # Copyright information # # Copyright (C) 2010 Jari Aalto # # License # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the # following conditions are met: # # 1. Redistributions of source code must retain the above # copyright notice, this list of conditions and the following # disclaimer. # # 2. Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials # provided with the distribution. # # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OF THIS # FILE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # DAMAGE. # # The license text is copy of the FreeBSD License available at # with following # modifications: wording "THIS SOFTWARE IS PROVIDED BY THE # FREEBSD PROJECT" was changed to "THIS SOFTWARE IS PROVIDED 'AS # IS'" and wording "IN NO EVENT SHALL THE FREEBSD PROJECT" was # changed to "IN NO EVENT SHALL THE AUTHOR(S)" # # Description # # Convert *.pod files to manual pages. ifneq (,) This makefile requires GNU Make. endif # This variable *must* be set when calling PACKAGE ?= dos2unix # Optional variables to set MANSECT ?= 1 PODCENTER ?= $$(date "+%Y-%m-%d") # Directories MANSRC = MANDEST = $(MANSRC) MANPOD = $(MANSRC)$(PACKAGE).pod MANPAGE = $(MANDEST)$(PACKAGE).$(MANSECT) POD2MAN = pod2man POD2MAN_FLAGS = MAN_NONLATIN ?= 1 PODFILES = $(wildcard ../*/man1/dos2unix.pod) MAN_OBJECTS = dos2unix.1 $(patsubst %.pod,%.1,$(PODFILES)) ifeq ($(MAN_NONLATIN),1) PODFILES_NONLATIN = $(wildcard ../nonlatin/*/man1/dos2unix.pod) MAN_OBJECTS_NONLATIN = dos2unix.1 $(patsubst %.pod,%.1,$(PODFILES_NONLATIN)) endif all: $(MAN_OBJECTS) $(MAN_OBJECTS_NONLATIN) MAN_OBJECTS_NONLATIN = $(patsubst %.pod,%.1,$(PODFILES_NONLATIN)) # The .pod files for Latin scripts are encoded in Latin-1 (ISO-8859-1/CP1252). # UTF-8 man pages are not properly displayed in a Windows Command Prompt, # therefore we keep them in Latin-1 format. # Cygwin 1.7 expects man pages to be in Latin-1 format. # The perl version of MinGW and DJGPP is 5.8.8. The pod2man command of perl # 5.8.8 does not yet have the options -u, --utf8, and does support the =encoding # command. # There are different *roff implementations. For now I assume we are using # groff (GNU-roff) which is wide spread, default on Linux, Cygwin, MinGW, and # DJGPP. The groff specific escape sequences may not work with other *roff # implementations, but they display OK when used in a Windows Command Prompt # using DJGPP's or MinGW's groff. Although sometimes characters are displayed # without their diacritics. # One day everything will be in UTF-8... # For the English manual it all makes no difference, because the English text # is plain ASCII. %.1 : %.pod # make target - create manual page from a *.pod page podchecker $< LC_CTYPE=C $(POD2MAN) $(POD2MAN_FLAGS) \ --center="$(PODCENTER)" \ --name="$(PACKAGE)" \ --section="$(MANSECT)" \ $< \ | perl -p -e 's/[Pp]erl v[0-9.]+/$(PACKAGE)/;' \ > $@ && \ rm -f pod*.tmp # fix for bug http://rt.perl.org/rt3//Public/Bug/Display.html?id=79410 # "Pod2man creates wrong ROFF esc sequences for Latin-1 characters." # Create groff (specific) escape sequences which work also on DOS/Windows. # See also: https://rt.cpan.org/Public/Bug/Display.html?id=73804 perl -pli.bak \ -e s/A\\\\\\*\'/\\\\[\'A]/g\; \ -e s/a\\\\\\*\'/\\\\[\'a]/g\; \ -e s/E\\\\\\*\'/\\\\[\'E]/g\; \ -e s/e\\\\\\*:/\\\\[:e]/g\; \ -e s/e\\\\\\*\'/\\\\[\'e]/g\; \ -e s/i\\\\\\*\'/\\\\[\'i]/g\; \ -e s/n\\\\\\*~/\\\\[~n]/g\; \ -e s/O\\\\\\*\'/\\\\[\'O]/g\; \ -e s/o\\\\\\*\'/\\\\[\'o]/g\; \ -e s/u\\\\\\*\'/\\\\[\'u]/g\; \ $@ # The .pod files under the 'nonlatin' folder are encoded in UTF-8. # For these manuals pod2man needs to support the =encoding command # and the --utf8 option. This is supported since perl 5.10.1. # Erwin W. nonlatin: $(MAN_OBJECTS_NONLATIN) ../nonlatin/ru/%.1 : ../nonlatin/ru/%.pod # make target - create manual page from a *.pod page podchecker $< $(POD2MAN) $(POD2MAN_FLAGS) \ --utf8 \ --center="$(PODCENTER)" \ --name="$(PACKAGE)" \ --section="$(MANSECT)" \ $< \ | perl -p -e 's/[Pp]erl v[0-9.]+/$(PACKAGE)/;' \ > $@ && \ rm -f pod*.tmp clean: rm -f $(MAN_OBJECTS) rm -f $(MAN_OBJECTS_NONLATIN) # End of of Makefile part dos2unix-6.0.4/man/nl/0000755000175500010010000000000012260366761013740 5ustar waterlanGeendos2unix-6.0.4/man/nl/man1/0000755000175500010010000000000012260366776014602 5ustar waterlanGeendos2unix-6.0.4/man/nl/man1/dos2unix.pod0000644000175500010010000004474712175006214017060 0ustar waterlanGeen/* # Copyright and License # # Copyright (C) 2009-2013 Erwin Waterlander # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice in the documentation and/or other materials provided with # the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Description # # To learn what TOP LEVEL section to use in manual pages, # see POSIX/Susv standard and "Utility Description Defaults" at # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag_01_11 # # This is manual page in Perl POD format. Read more at # http://perldoc.perl.org/perlpod.html or run command: # # perldoc perlpod | less # # To check the syntax: # # podchecker *.pod # # Create manual page with command: # # pod2man PAGE.N.pod > PAGE.N */ =pod =head1 NAAM dos2unix - DOS/Mac naar Unix en vice versa tekstbestand formaat omzetter =head1 OVERZICHT dos2unix [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...] unix2dos [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...] =head1 BESCHRIJVING Het Dos2unix pakket bevat toepassingen C en C om platte tekstbestanden in DOS of Mac formaat naar Unix om te zetten en vice versa. In DOS/Windows tekstbestanden bestaat een regeleinde uit een combinatie van twee tekens: een 'Carriage Return' (CR) gevolgd door een 'Line Feed' (LF). In Unix tekstbestanden bestaat een regeleinde uit een enkel 'Newline' teken die gelijk is aan een DOS 'Line Feed' (LF) teken. In Mac tekst bestanden, voor Mac OS X, bestaan regeleindes uit een enkel 'Carriage Return' teken. Mac OS X is Unix gebaseerd en heeft dezelfde regeleindes als Unix. Naast regeleindes kan Dos2unix ook de codering van bestanden omzetten. Enkele DOS code tabellen kunnen omgezet worden naar Unix Latin-1. En Windows Unicode (UTF-16) bestanden kunnen geconverteerd worden naar Unix Unicode (UTF-8) bestanden. Binaire bestanden worden automatisch overgeslagen, behalve als de omzetting geforceerd wordt. Niet-reguliere bestanden, zoals mappen en FIFO's, worden automatisch overgeslagen. Symbolische koppelingen en hun doelen blijven standaard onaangeroerd. Optioneel kunnen symbolische koppelingen worden vervangen, of de uitvoer kan naar het doel van de symbolische koppeling worden geschreven. Symbolische koppelingen op Windows worden niet ondersteund. Windows symbolische koppelingen worden altijd vervangen, de doelen onaangeroerd gelaten. Dos2unix is gemodelleerd naar dos2unix onder SunOS/Solaris en heeft gelijke conversiemodi. =head1 OPTIES =over 4 =item B<--> Behandel alle volgende opties als bestandsnamen. Gebruik deze optie als je bestanden wil converteren wiens naam met een streepje begint. Bijvoorbeeld, om een bestand genaamd "-foo" om te zetten, gebruik je de volgende opdracht: dos2unix -- -foo Of in nieuw-bestand-modus: dos2unix -n -- -foo uit.txt =item B<-ascii> Converteer alleen regeleindes. Dit is de standaard conversiemodus. =item B<-iso> Conversie tussen DOS en ISO-8859-1 lettertekenreeks. Zie ook paragraaf CONVERSIEMODI. =item B<-1252> Gebruik Windows codetabel 1252 (West-Europees). =item B<-437> Gebruik DOS codetabel 437 (VS). Dit is de standaard codetabel die gebruikt wordt bij ISO conversie. =item B<-850> Gebruik DOS codetabel 850 (West-Europees). =item B<-860> Gebruik DOS codetabel 860 (Portugees). =item B<-863> Gebruik DOS codetabel 863 (Canadees Frans). =item B<-865> Gebruik DOS codetabel 865 (Scandinavisch). =item B<-7> Converteer 8 bit lettertekens naar 7 bit spatie. =item B<-c, --convmode CONVMODUS> Stel conversiemodus in. Waarbij CONVMODUS een is van: I, I<7bit>, I, I met ascii als standaard instelling. =item B<-f, --force> Forceer omzetting van binaire bestanden. =item B<-h, --help> Laat help tekst zien. =item B<-k, --keepdate> Behoud de datum van het invoerbestand in het uitvoerbestand. =item B<-L, --license> Laat de software licentie zien. =item B<-l, --newline> Voeg een extra regeleinde toe. B: Alleen DOS regeleindes worden omgezet naar twee Unix regeleindes. In Mac modus worden alleen Mac regeleindes omgezet naar twee Unix regeleindes. B: Aleen Unix regeleindes worden omgezet naar twee DOS regeleindes. In Mac modus worden Unix regeleindes omgezet naar twee Mac regeleindes. =item B<-m, --add-bom> Schrijf een UTF-8 Byte Order Mark in het uitvoerbestand. Gebruik deze optie nooit als de codering het van uitvoerbestand geen UTF-8 is. Zie ook paragraaf UNICODE. =item B<-n, --newfile INVOERBESTAND UITVOERBESTAND ...> Nieuw-bestand-modus. Converteer bestand INVOERBESTAND en schrijf naar bestand UITVOERBESTAND. Bestandsnamen moeten opgegeven worden in paren. Jokertekens moeten NIET gebruikt worden, anders verlies je bestanden. De persoon die de conversie start in nieuw-bestand (gepaarde) modus wordt de eigenaar van het geconverteerde bestand. De lees/schrijf permissies van het nieuwe bestand worden de permissies van het originele bestand minus de umask(1) van de persoon die de conversie draait. =item B<-o, --oldfile BESTAND ...> Oud-bestand-modus. Converteer bestand BESTAND en overschrijf het. Dit is de standaard modus. Jokertekens kunnen gebruikt worden. In oud-bestand (plaatsvervangende) modus krijgt het geconverteerde bestand dezelfde eigenaar, groep en lees/schrijf rechten als het originele bestand. Ook wanneer het bestand wordt omgezet door een andere gebruiker die schrijfrechten heeft op het bestand (b.v. gebruiker root). De omzetting wordt afgebroken wanneer het niet mogelijk is de originele waardes te behouden. Verandering van eigenaar kan betekenen dat de originele eigenaar het bestand niet meer kan lezen. Verandering van groep zou een veiligheidsrisico kunnen zijn, het bestand zou leesbaar kunnen worden voor personen voor wie het niet bestemd is. Behoud van eigenaar, groep en lees/schrijf rechten is alleen ondersteund op Unix. =item B<-q, --quiet> Stille werking. Onderdruk alle waarschuwingen. De teruggave waarde is nul. Behalve wanneer verkeerde opties worden gegeven. =item B<-s, --safe> Sla binaire bestanden over (standaard). =item B<-ul, --assume-utf16le> Veronderstel dat het formaat van het invoerbestand UTF-16LE is. Wanneer er een Byte Order Mark (BOM) in het invoerbestand zit dan gaat de BOM voor op deze optie. Wanneer een verkeerde aanname is gemaakt (het invoerbestand was geen UTF-16LE formaat) en de conversie verliep met succes, dan krijgt u een UTF-8 bestand met verkeerde tekst. De verkeerde conversie kan ongedaan worden gemaakt door met iconv(1) het UTF-8 uitvoerbestand terug om te zetten naar UTF-16LE. Dit zal het originele bestand terug brengen. De aanname van UTF-16LE werkt als een I. Door te schakelen naar I modus wordt de UTF-16LE veronderstelling uitgeschakeld. =item B<-ub, --assume-utf16be> Veronderstel dat het formaat van het invoerbestand UTF-16BE is. Deze optie werkt hetzelfde als optie C<-ul>. =item B<-F, --follow-symlink> Volg symbolische koppelingen en coverteer de doelen. =item B<-R, --replace-symlink> Vervang symbolische koppelingen door geconverteerde bestanden (originele doelbestanden blijven ongewijzigd). =item B<-S, --skip-symlink> Laat symbolische koppelingen en doelen ongewijzigd (standaard). =item B<-V, --version> Laat versie informatie zien. =back =head1 MAC MODUS In normale modus worden DOS regeleindes naar Unix omgezet en vice versa. Mac regeleindes worden niet omgezet. In Mac modus worden Mac regeleindes naar Unix omgezet en vice versa. DOS regeleindes blijven ongewijzigd. Om in Mac modus te draaien gebruik de schakeloptie C<-c mac> of gebruik de opdrachten C of C. =head1 CONVERSIEMODI Conversie-modi I, I<7bit>, en I zijn gelijk aan die van dos2unix/unix2dos onder SunOS/Solaris. =over 4 =item B In modus C worden alleen regeleindes omgezet. Dit is de standaard modus. Hoewel de naam van deze modus ASCII is, wat een 7 bit standaard is, is de werkelijke modus 8 bit. Gebruik altijd deze modus wanneer u Unicode UTF-8 bestanden omzet. =item B<7bit> Alle 8 bit niet-ASCII lettertekens (met waardes van 128 t/m 255) worden omgezet naar een 7 bit spatie. =item B Lettertekens worden omgezet tussen een DOS lettertekenreeks (codetabel) en ISO lettertekenreeks ISO-8859-1 op Unix. DOS lettertekens zonder gelijkwaardig ISO-8859-1 teken, waarvoor geen omzetting mogelijk is, worden omgezet in een punt. Het zelfde geldt voor ISO-8859-1 tekens zonder DOS tegenhanger. Wanneer alleen optie C<-iso> gebruikt wordt, zal dos2unix proberen de actieve codetabel te gebruiken. Als dat niet mogelijk is wordt codetabel CP437 gebruikt, die met name in de VS gebruikt word. Om een bepaalde codetabel te forceren gebruik opties C<-850> (West-Europees), C<-860> (Portugees), C<-863> (Canadees Frans) of C<-865> (Scandinavisch). Windows codetabel CP1252 (West-Europees) wordt ook ondersteund met optie C<-1252>. Gebruik voor andere codetabellen dos2unix in combinatie met iconv(1). Iconv kan omzetten tussen een lange lijst letterteken-coderingen. Gebruik ISO conversie nooit op Unicode tekst bestanden. Het zal UTF-8 gecodeerde bestanden beschadigen. Enkele voorbeelden: Omzetten van DOS standaard codetabel naar Unix Latin-1 dos2unix -iso -n in.txt uit.txt Omzetten van DOS CP850 naar Unix Latin-1 dos2unix -850 -n in.txt uit.txt Omzetten van Windows CP1252 naar Unix Latin-1 dos2unix -1252 -n in.txt uit.txt Omzetten van Windows CP1252 naar Unix UTF-8 (Unicode) iconv -f CP1252 -t UTF-8 in.txt | dos2unix > uit.txt Omzetten van Unix Latin-1 naar DOS standaard code tabel unix2dos -iso -n in.txt uit.txt Omzetten van Unix Latin-1 naar DOS CP850 unix2dos -850 -n in.txt uit.txt Omzetten van Unix Latin-1 naar Windows CP1252 unix2dos -1252 -n in.txt uit.txt Omzetten van Unix UTF-8 (Unicode) naar Windows CP1252 unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > uit.txt Zie ook L en L. =back =head1 UNICODE =head2 Coderingen Er bestaan verschillende Unicode coderingen. Op Unix en Linux zijn Unicode bestanden typisch gecodeerd in UTF-8. Op Windows kunnen Unicode tekst bestanden gecodeerd zijn in UTF-8, UTF-16 of UTF-16 big endian, maar meestal zijn ze gecodeerd in UTF-16 formaat. =head2 Conversie Unicode tekst bestanden kunnen DOS, Unix of Mac regeleindes hebben, net als reguliere tekst bestanden. Alle versies van dos2unix en unix2dos kunnen UTF-8 gecodeerde bestanden omzetten, want UTF-8 is ontworpen op compatibiliteit met ASCII. Dos2unix en unix2dos met Unicode UTF-16 ondersteuning, kunnen little en big endian UTF-16 gecodeerde tekst bestanden lezen. Om er achter te komen of dos2unix gebouwd is met UTF-16 ondersteuning type C. De Windows versies van dos2unix en unix2dos converteren UTF-16 gecodeerde bestanden altijd naar UTF-8 gecondeerde bestanden. Unix versies van dos2unix/unix2dos zetten UTF-16 gecodeerde bestanden om naar de lokale karakter codering als die gelijk is aan UTF-8. Gebruik de opdracht locale(1) om uit te vinden wat de lokale karakter codering is. Omdat UTF-8 geformateerde tekstbestanden zowel op Windows en Unix goed ondersteund worden, hebben dos2unix en unix2dos geen optie om UTF-16 bestanden te schrijven. Alle UTF-16 karakters kunnen worden omgezet naar UTF-8. De omzetting van UTF-16 naar UTF-8 is verliesvrij. Op Unix worden UTF-16 bestanden overgeslagen als de locale karakter codering ongelijk is aan UTF-8, om te voorkomen dat er per ongeluk tekst verloren gaat. Wanneer een UTF-16 naar UTF-8 conversiefout optreedt, bijvoorbeeld wanneer het UTF-16 invoerbestand een fout bevat, wordt het bestand overgeslagen. ISO en 7-bit conversie werkt niet op UTF-16 bestanden. =head2 Byte Order Mark Op Windows hebben Unicode tekstbestanden typisch een Byte Order Mark (BOM), omdat veel Windows programma's (inclusief Kladblok) standaard een BOM toevoegen. Zie ook L. Op Unix hebben Unicode tekstbestanden typisch geen BOM. Er wordt aangenomen dat de codering van tekstbestanden gelijk is aan de lokale karakter codering. Dos2unix kan alleen detecteren of een bestand in UTF-16 formaat is als het bestand een BOM heeft. Wanneer een UTF-16 bestand geen BOM heeft, ziet dos2unix het bestand als een binair bestand. Gebruik optie C<-ul> of C<-ub> om een UTF-16 bestand zonder BOM om te zetten. Dos2unix schrijft nooit een BOM in het uitvoerbestand, tenzij optie C<-m> gebruikt wordt. Unix2dos schrijft een BOM in het uitvoerbestand wanneer het invoerbestand een BOM heeft, of wanneer optie C<-m> gebruikt is. =head2 Unicode voorbeelden Omzetten van Windows UTF-16 (met BOM) naar Unix UTF-8 dos2unix -n in.txt uit.txt Omzetten van Windows UTF-16LE (zonder BOM) naar Unix UTF-8 dos2unix -ul -n in.txt uit.txt Omzetten van Unix UTF-8 naar Windows UTF-8 met BOM unix2dos -m -n in.txt uit.txt Omzetten van Unix UTF-8 naar Windows UTF-16 unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > uit.txt =head1 VOORBEELDEN Lees invoer van 'stdin' en schrijf uitvoer naar 'stdout'. dos2unix dos2unix -l -c mac Omzetten en vervangen a.txt. Omzetten en vervangen b.txt. dos2unix a.txt b.txt dos2unix -o a.txt b.txt Omzetten en vervangen a.txt in ascii conversiemodus. dos2unix a.txt Omzetten en vervangen a.txt in ascii conversiemodus. Omzetten en vervangen b.txt in 7bit conversiemodus. dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Omzetten a.txt van Mac naar Unix format. dos2unix -c mac a.txt mac2unix a.txt Omzetten a.txt van Unix naar Mac format. unix2dos -c mac a.txt unix2mac a.txt Omzetten en vervangen a.txt met behoud van originele datum. dos2unix -k a.txt dos2unix -k -o a.txt Omzetten a.txt en schrijf naar e.txt. dos2unix -n a.txt e.txt Omzetten a.txt en schrijf naar e.txt, behoud datum e.txt gelijk aan a.txt. dos2unix -k -n a.txt e.txt Omzetten en vervangen a.txt. Omzetten b.txt en schrijf naar e.txt. dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Omzetten c.txt en schrijf naar e.txt. Omzetten en vervangen a.txt. Omzetten en vervangen b.txt. Omzetten d.txt en schrijf naar f.txt. dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 RECURSIEVE CONVERSIE Gebruik dos2unix in combinatie met de find(1) en xargs(1) opdrachten om tekstbestanden in een directoryboomstructuur recursief om te zetten. Bijvoorbeeld om alle .txt bestanden in de directoryboom onder de huidige map te converteren type: find . -name *.txt |xargs dos2unix =head1 LOKALISATIE =over 4 =item B The primaire taal wordt geselecteerd met de omgevingsvariabele LANG. De LANG variabele bestaat uit verschillende onderdelen. Het eerste deel is in kleine letters de taalcode. Het tweede deel is optioneel en is de landcode in hoofdletters, voorafgegaan door een laag streepje. Er is ook een optioneel derde deel: lettertekenreeks-codering, voorafgegaan door een punt. Enkele voorbeelden voor een POSIX staandaard shell: export LANG=nl Nederlands export LANG=nl_NL Nederlands, Nederland export LANG=nl_BE Nederlands, Belgi export LANG=es_ES Spaans, Spanje export LANG=es_MX Spaans, Mexico export LANG=en_US.iso88591 Engels, VS, Latin-1 codering export LANG=en_GB.UTF-8 Engels, GB, UTF-8 codering Voor een complete lijst van taal- en landcodes zie de gettext handleiding: L Op Unix systemen kunt u de opdracht locale(1) gebruiken om specifieke lokalisatie informatie te verkrijgen. =item B Met de omgevingsvariabele LANGUAGE kunt u een prioriteitenlijst specificeren van talen, gescheiden door dubbele punten. Dos2unix geeft voorkeur aan LANGUAGE boven LANG. Bijvoorbeeld, eerst Nederlands en dan Duits: C. U moet eerst lokalisatie in werking stellen, met het instellen van LANG (of LC_ALL) in een waarde ongelijk aan "C", voordat u een talen prioriteitenlijst kunt gebruiken via de LANGUAGE variabele. Zie ook de gettext handleiding: L Als u een taal kiest die niet beschikbaar is worden de standaard Engelse berichten gebruikt. =item B Met de omgevingsvariabele DOS2UNIX_LOCALEDIR kan de LOCALEDIR gebruikt tijdens compilatie worden overstemd. LOCALEDIR wordt gebruikt om de taalbestanden te vinden. De GNU staandaard waarde is C. De optie "-V" laat de gebruikte LOCALEDIR zien. Voorbeeld (POSIX shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 TERUGGAVE WAARDE Bij succes wordt nul terug gegeven. Wanneer een systeemfout optreedt wordt het laatste systeemfoutnummer terug gegeven. Bij andere fouten wordt 1 terug gegeven. De teruggave is altijd nul in de modus stille werking, behalve wanneer verkeerde opties worden gegeven. =head1 STANDAARDEN L L L L =head1 AUTEURS Benjamin Lin - , Bernd Johannes Wuebben (mac2unix modus) - , Christian Wurll (voeg extra regeleinde toe) - , Erwin Waterlander - Project pagina: L SourceForge pagina: L Freecode: L =head1 ZIE OOK file(1) find(1) iconv(1) locale(1) xargs(1) =cut dos2unix-6.0.4/man/nonlatin/0000755000175500010010000000000012260366761015151 5ustar waterlanGeendos2unix-6.0.4/man/nonlatin/ru/0000755000175500010010000000000012260366761015577 5ustar waterlanGeendos2unix-6.0.4/man/nonlatin/ru/man1/0000755000175500010010000000000012260366761016433 5ustar waterlanGeendos2unix-6.0.4/mingw.mak0000644000175500010010000000214112235307262014356 0ustar waterlanGeen # Author: Erwin Waterlander # Copyright (C) 2009 Erwin Waterlander # This file is distributed under the same license as the dos2unix package. prefix=c:/usr/local ENABLE_NLS=1 ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv # Using GnuWin32 gettext,iconv #ZIPOBJ_EXTRA = bin/libintl3.dll bin/libiconv2.dll # Using MinGW gettext,iconv ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll endif all: $(MAKE) all EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" EO_XNOTATION=1 MAN_NONLATIN= install: $(MAKE) install EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" EO_XNOTATION=1 MAN_NONLATIN= uninstall: $(MAKE) uninstall EXE=.exe prefix=$(prefix) MAN_NONLATIN= clean: $(MAKE) clean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) mostlyclean: $(MAKE) mostlyclean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) dist: $(MAKE) dist-zip EXE=.exe prefix=$(prefix) VERSIONSUFFIX="-win32" ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" ENABLE_NLS=$(ENABLE_NLS) strip: $(MAKE) strip LINK="cp -f" EXE=.exe dos2unix-6.0.4/mingw32.mak0000644000175500010010000000220512245224110014513 0ustar waterlanGeen # Author: Erwin Waterlander # Copyright (C) 2013 Erwin Waterlander # This file is distributed under the same license as the dos2unix package. CC = gcc CRT_GLOB_OBJ = C:/mingw32/i686-w64-mingw32/lib/CRT_glob.o prefix=c:/usr/local ENABLE_NLS= ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv # Using MinGW gettext,iconv #ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll endif LIBS_EXTRA += $(CRT_GLOB_OBJ) all: $(MAKE) all EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" CC=$(CC) EO_XNOTATION=1 MAN_NONLATIN= install: $(MAKE) install EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" CC=$(CC) EO_XNOTATION=1 MAN_NONLATIN= uninstall: $(MAKE) uninstall EXE=.exe prefix=$(prefix) MAN_NONLATIN= clean: $(MAKE) clean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) mostlyclean: $(MAKE) mostlyclean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) dist: $(MAKE) dist-zip EXE=.exe prefix=$(prefix) VERSIONSUFFIX="-win32" ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" ENABLE_NLS=$(ENABLE_NLS) strip: $(MAKE) strip LINK="cp -f" EXE=.exe dos2unix-6.0.4/mingw64.mak0000644000175500010010000000230112235307262014526 0ustar waterlanGeen # Author: Erwin Waterlander # Copyright (C) 2012 Erwin Waterlander # This file is distributed under the same license as the dos2unix package. CC = x86_64-w64-mingw32-gcc STRIP = x86_64-w64-mingw32-strip CRT_GLOB_OBJ = C:/mingw64/mingw/lib/CRT_glob.o prefix=c:/usr/local64 ENABLE_NLS= ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv # Using MinGW gettext,iconv #ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll endif LIBS_EXTRA += $(CRT_GLOB_OBJ) all: $(MAKE) all EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" CC=$(CC) EO_XNOTATION=1 MAN_NONLATIN= install: $(MAKE) install EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" CC=$(CC) EO_XNOTATION=1 MAN_NONLATIN= uninstall: $(MAKE) uninstall EXE=.exe prefix=$(prefix) MAN_NONLATIN= clean: $(MAKE) clean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) mostlyclean: $(MAKE) mostlyclean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) dist: $(MAKE) dist-zip EXE=.exe prefix=$(prefix) VERSIONSUFFIX="-win64" ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" ENABLE_NLS=$(ENABLE_NLS) strip: $(MAKE) strip LINK="cp -f" EXE=.exe STRIP=$(STRIP) dos2unix-6.0.4/NEWS.txt0000644000175500010010000001062512260365416014071 0ustar waterlanGeen2013-12-30: Version 6.0.4 * New options -ul and -ub to convert UTF-16 files without BOM. * New Russian translation of the messages. * Build 32 bit Windows binaries with Large File Support (LFS) by using mingw-w64 for 32 bit Windows. * When a binary symbol is encountered the value is printed. 2013-01-25: Version 6.0.3 * Source code compiles with Microsoft Visual C. * Print system error when writing output fails. 2012-09-06: Version 6.0.2 * The locale encoding detection has been fixed when NLS was disabled. * Print line number when a binary symbol is found. * Updated makefiles for Watcom C, and added a new one for OS/2. 2012-07-25: Version 6.0.1 * Update Spanish translations. * Update manual. 2012-05-06: Version 6.0 * Conversion of Windows UTF-16 files to Unix UTF-8 files. * Conversion of Unix UTF-8 files to Windows UTF-8 files with byte order mark. 2012-03-10: Version 5.3.3 * Enabled wildcard expansion for all versions. * Fixed a compilation error when debug was enabled. 2012-01-27: Version 5.3.2 * New homepage URL: http://waterlan.home.xs4all.nl/dos2unix.html * Compiles for native MSYS. * Compile with OpenWatcom for DOS32 and Win32. * Detect code page on OS/2. * Support wild cards on OS/2. 2011-08-09: Version 5.3.1 * Spanish translation of messages and manual. * File ownership is maintained in old file mode (Unix only). * Dos2unix and Unix2dos share the same language files. * Code cleanup. 2011-04-26: Version 5.3 * Improved handling of symbolic links. New options -F, -R, -S. * Improved handling and reporting of errors. * Source code improvements for Cygwin. Behave exactly as on Linux. * New option --. Treat all following options as file names. 2011-03-04: Version 5.2.1 * PDF and PostScript generation is optional. No default dependency on GhostScript and Groff. * Enable optional Large File Support (LFS). * Esperanto x-notation is optional. No longer installation of non-standard locale 'eo-x'. * Improved error messages. 2011-01-31: Version 5.2 * ISO conversion mode supports same DOS code pages as SunOS dos2unix does: CP437 (US), CP850 (Western European), CP860 (Portuguese), CP863 (French Canadian), and CP865 (Nordic). * ISO conversion mode supports Windows code page CP1252 (Western). * SunOS compatible options -ascii, -iso, -7, -437, -850, -860, -863, and -865. * Active code page detection for ISO mode. * Fixed ISO conversion of non-breaking space (NBSP). * ISO and 7bit mode can be used in Mac mode. * Treat ASCII Form Feed control characters as valid text. * Update manual pages. * Don't include generated documentation files in Unix source package. * Create a source package in DOS text format. 2010-08-18: Version 5.1.1 * Added Dutch translation of the manual. * Win64 port. * Win32 binary package uses patched MinGW's libintl, with builtin * relocation support. * Support compilation in DOSBox (8.3 file names where needed). * Fixed compilation on Darwin OS. 2010-04-03: Version 5.1 * Esperanto translations have been added. * Ports to 16 bit DOS have been made. * Command-line options can be set in stdio mode. * Bugfix dos2unix MAC mode: Don't change DOS line endings. * Create stubs for DOS32 versions of mac2unix and unix2mac. * Localization information has been added to the manual. * Man pages have been merged. * Man page generation from Perl POD file. 2010-02-16: Version 5.0 * Dos2unix and Unix2dos have been bundled in a single package. * German translations have been added. * Dos2unix -l --newline also works in MAC mode. * Unix2dos also got option -l, --newline. * Added MAC mode to Unix2dos: Convert Unix line endings to Mac line endings. * Cleanup of messages and manual. 2010-01-24: Version 4.1.2 * Preserves file modes in new file mode. 2010-01-21: Version 4.1.1 * Fixes a compilation problem on FreeBSD. 2009-12-28: Version 4.1 Automatically skips binary and non-regular files, and the ISO mode has been cleaned up (see ChangeLog). 2009-12-21: Version 4.0.1 Adds a port to OS/2 Warp. Two wrong conversions in ISO mode have been fixed. The manual page has been updated. 2009-12-15: Version 4.0 Adds internationalisation (Native Language Support, NLS). A Dutch translation has been added. Ports to Windows and DOS have been made. The problem in DOS/Windows stdio mode has been fixed. The manual has been updated. dos2unix-6.0.4/po/0000755000175500010010000000000012260366761013172 5ustar waterlanGeendos2unix-6.0.4/po/de.po0000644000175500010010000004200012245223471014107 0ustar waterlanGeen# German messages for dos2unix # Copyright (C) 2009-2013 # This file is distributed under the same license as the dos2unix package. # # Philipp Thomas , 2009, 2010, 2011. # Philipp Thomas , 2009,2010, 2011. # Lars Wendler 2013 msgid "" msgstr "" "Project-Id-Version: dos2unix 5.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-26 23:08+0100\n" "PO-Revision-Date: 2010-01-24 09:00+0100\n" "Last-Translator: Philipp Thomas \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: dos2unix.c:76 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright © 2009-2013 Erwin Waterlander\n" "Copyright © 1998 Christian Wurll (Version 3.1)\n" "Copyright © 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright © 1994,1995 Benjamin Lin\n" "Alle Rechte vorbehalten.\n" "\n" #: dos2unix.c:164 dos2unix.c:202 unix2dos.c:132 unix2dos.c:185 #, c-format msgid "Binary symbol 0x00%02X found at line %d\n" msgstr "Ein binäres Symbol 0x00%02X wurde in Zeile %d gefunden\n" #: dos2unix.c:179 dos2unix.c:218 dos2unix.c:243 dos2unix.c:355 dos2unix.c:391 #: dos2unix.c:413 unix2dos.c:162 unix2dos.c:199 unix2dos.c:220 unix2dos.c:238 #: unix2dos.c:362 unix2dos.c:396 unix2dos.c:414 unix2dos.c:429 #, c-format msgid "can not write to output file: %s\n" msgstr "In die Ausgabedatei kann nicht geschrieben werden: %s\n" #: dos2unix.c:259 dos2unix.c:428 unix2dos.c:253 unix2dos.c:443 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "Programmfehler, der Konvertierungsmodus %d ist unzulässig\n" #: dos2unix.c:317 unix2dos.c:311 #, c-format msgid "using code page %d.\n" msgstr "Codepage %d wird verwendet.\n" #: dos2unix.c:342 dos2unix.c:377 unix2dos.c:334 unix2dos.c:384 #, c-format msgid "Binary symbol 0x%02X found at line %d\n" msgstr "Ein binäres Symbol 0x%02X wurde in Zeile %d gefunden\n" #: dos2unix.c:516 unix2dos.c:531 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Die temporäre Ausgabedatei konnte nicht geöffnet werden: %s\n" #: dos2unix.c:523 unix2dos.c:538 #, c-format msgid "using %s as temporary file\n" msgstr "%s wird als temporäre Datei verwendet\n" #: dos2unix.c:636 unix2dos.c:651 #, c-format msgid "Failed to write to temporary output file %s: %s\n" msgstr "Die temporäre Ausgabedatei %s konnte nicht geschrieben werden: %s\n" #: dos2unix.c:671 unix2dos.c:686 #, c-format msgid "Failed to change the permissions of temporary output file %s: %s\n" msgstr "Das Ändern der Rechte der temporären Ausgabedatei %s scheiterte: %s\n" #: dos2unix.c:690 unix2dos.c:705 #, c-format msgid "Failed to change the owner and group of temporary output file %s: %s\n" msgstr "" "Das Ändern des Eigentümers und der Gruppe der temporären Ausgabedatei %s " "scheiterte: %s\n" #: dos2unix.c:743 unix2dos.c:758 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "es gab Probleme beim Auflösen der symbolischen Verknüpfung »%s«\n" #: dos2unix.c:744 dos2unix.c:778 unix2dos.c:759 unix2dos.c:793 #, c-format msgid " output file remains in '%s'\n" msgstr " Die Ausgabedatei verbleibt in »%s«\n" #: dos2unix.c:773 unix2dos.c:788 #, c-format msgid "problems renaming '%s' to '%s': %s\n" msgstr "Beim Umbenennen von »%s« zu »%s« sind Probleme aufgetreten: %s\n" #: dos2unix.c:776 unix2dos.c:791 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " welche das Ziel der symbolischen Verknüpfung »%s« ist\n" #: dos2unix.c:874 unix2dos.c:889 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "" "Fehler: Der Inhalt der Umgebungsvariablen DOS2UNIX_LOCALEDIR ist zu lang.\n" #: dos2unix.c:977 dos2unix.c:1014 unix2dos.c:992 unix2dos.c:1029 #, c-format msgid "active code page: %d\n" msgstr "aktive Codepage: %d\n" #: dos2unix.c:1024 unix2dos.c:1039 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "Der angegebene Konvertierungsmodus %s ist unzulässig\n" #: dos2unix.c:1034 unix2dos.c:1049 #, c-format msgid "option '%s' requires an argument\n" msgstr "Die Option »%s« benötigt ein Argument\n" #: dos2unix.c:1047 dos2unix.c:1061 dos2unix.c:1255 unix2dos.c:1062 #: unix2dos.c:1076 unix2dos.c:1276 #, c-format msgid "target of file %s not specified in new file mode\n" msgstr "Das Ziel der Datei %s wurde für den Neudatei-Modus nicht angegeben\n" #: dos2unix.c:1091 dos2unix.c:1175 unix2dos.c:1106 unix2dos.c:1193 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "%s wird übersprungen, da es keine reguläre Datei ist\n" #: dos2unix.c:1098 unix2dos.c:1113 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "" "%s wird übersprungen, Ausgabedatei %s ist eine symbolische Verknüpfung.\n" #: dos2unix.c:1105 dos2unix.c:1189 unix2dos.c:1120 unix2dos.c:1207 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "" "Symbolische Verknüpfung %s wird übersprungen da das Ziel keine reguläre " "Datei ist.\n" #: dos2unix.c:1112 unix2dos.c:1127 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "" "%s wird übersprungen, das Ziel der symbolischen Verknüpfung %s ist keine " "reguläre Datei.\n" #: dos2unix.c:1119 dos2unix.c:1196 unix2dos.c:1134 unix2dos.c:1214 #, c-format msgid "Skipping binary file %s\n" msgstr "binäre Datei %s wird übersprungen\n" #: dos2unix.c:1126 dos2unix.c:1203 unix2dos.c:1141 unix2dos.c:1221 #, c-format msgid "code page %d is not supported.\n" msgstr "Codepage %d wird nicht unterstützt.\n" #: dos2unix.c:1133 dos2unix.c:1210 unix2dos.c:1148 unix2dos.c:1228 #, c-format msgid "" "Skipping UTF-16 file %s, the current locale character encoding is not " "UTF-8.\n" msgstr "" "UTF-16 Datei %s wird übersprungen, da die derzeitige Zeichenkodierung nicht " "UTF-8 ist.\n" #: dos2unix.c:1140 dos2unix.c:1217 unix2dos.c:1155 unix2dos.c:1235 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "UTF-16 Datei %s wird übersprungen, da wchar_t %d Bytes groß ist.\n" #: dos2unix.c:1147 dos2unix.c:1224 unix2dos.c:1162 unix2dos.c:1242 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n" msgstr "" "UTF-16 Datei %s wird übersprungen, da beim Umwandeln ein Fehler auftrat.\n" #: dos2unix.c:1153 #, c-format msgid "converting file %s to file %s in Unix format ...\n" msgstr "Datei %s wird zu Datei %s im Unix-Format umgewandelt ...\n" #: dos2unix.c:1160 unix2dos.c:1178 #, c-format msgid "problems converting file %s to file %s\n" msgstr "Beim Konvertieren von Datei %s zu Datei %s sind Probleme aufgetreten\n" #: dos2unix.c:1182 unix2dos.c:1200 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Symbolische Verknüpfung %s wird übersprungen.\n" #: dos2unix.c:1230 #, c-format msgid "converting file %s to Unix format ...\n" msgstr "Datei %s wird ins Unix-Format umgewandelt ...\n" #: dos2unix.c:1237 unix2dos.c:1258 #, c-format msgid "problems converting file %s\n" msgstr "Beim Umwandeln von Datei %s sind Probleme aufgetreten\n" #: unix2dos.c:66 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright © 2009-2013 Erwin Waterlander\n" "Copyright © 1994,1995 Benjamin Lin\n" "Alle Rechte vorbehalten.\n" "\n" #: unix2dos.c:1169 #, c-format msgid "converting file %s to file %s in Mac format ...\n" msgstr "Datei %s wird in Datei %s im Mac-Format konvertiert ...\n" #: unix2dos.c:1171 #, c-format msgid "converting file %s to file %s in DOS format ...\n" msgstr "Datei %s wird in Datei %s im DOS-Format konvertiert ...\n" #: unix2dos.c:1249 #, c-format msgid "converting file %s to Mac format ...\n" msgstr "Datei %s wird ins Mac-Format konvertiert ...\n" #: unix2dos.c:1251 #, c-format msgid "converting file %s to DOS format ...\n" msgstr "Datei %s wird ins DOS-Format konvertiert ...\n" #: common.c:169 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "Verbreitung und Verwendung als Quelltext oder Binärdatei, in geänderter\n" "oder ungeänderter Form sind gestattet, soweit die folgenden Bedingungen\n" "eingehalten werden:\n" "1. Weiterverbreitung des Quellcodes muss den obigen Copyrightshinweis,\n" " Diese Liste von Bedingungen sowie den folgenden Haftungsausschlus\n" " beibehalten.\n" "2. Weiterverbreitung in binärer Form muss den obigen Copyright-Hinweis\n" " in der Dokumentation oder anderem der Distribution beiliegenden\n" " Material wiedergeben.\n" "\n" "DIESE SOFTWARE WIRD VOM AUTHOR WIE VORLIEGT ZUR VERFÜGUNG GESTELLT\n" "UND JEGLICHE AUSDRÜCKLICH GENANNTEN ODER IMPLIZITEN GARANTIEN,\n" "EINSCHLIESLICH, ABER NICHT DARAUF BESCHRÄNKT, DER GARANTIE DER\n" "HANDELBARKEIT UND DER EIGNUNG FÜR EINEN BESTIMMTEN ZWECK WERDEN\n" "HIERMIT AUSGESCHLOSSEN. IN KEINEM WIE AUCH IMMER GELAGERTEN FALL KANN\n" "DER AUTHOR FÜR IRGENDWELCHE DIREKTEN ODER INDIREKTEN, ZUFÄLLIGEN,\n" "BESONDEREN ODER BEISPIELHAFTEN SCHÄDEN (EINSCHLIESSLICH ABER NICHT\n" "AUSSCHLIESSLICH DER LIEFERUNG VON ERSATZGÜTERN ODER DIENSTEN;VERLUST\n" "DER NUTZBARKEIT, DER DATEN ODER DER GEWINNE ODER ETWAIGEN VERDIENST-\n" "AUSFALL-ENTSCHÄDIGUNGEN) HAFTBAR GEMACHT WERDEN, WIE AUCH IMMER SIE\n" "VERURSACHT WURDEN UND WELCHE HAFTUNGSMÖGLICHKEIT ZUGRUNDE GELEGT WIRD,\n" "SEI ES DURCH VERTRAG, VERBINDLICHKEIT ODER SCHADEN (EINSCHLIESSLICH\n" "FAHRLÄSSIGKEIT), DIE AUS DER VERWENDUNG DIESER SOFTWARE ERWÄCHST,\n" "SELBST WENN AUF DIE MÖGLICHKIET SOLCHER SCHÄDEN HINGEWIESEN WURDE.\n" #: common.c:195 #, c-format msgid "" "%s %s (%s)\n" "Usage: %s [options] [file ...] [-n infile outfile ...]\n" " -ascii convert only line breaks (default)\n" " -iso conversion between DOS and ISO-8859-1 character set\n" " -1252 Use Windows code page 1252 (Western European)\n" " -437 Use DOS code page 437 (US) (default)\n" " -850 Use DOS code page 850 (Western European)\n" " -860 Use DOS code page 860 (Portuguese)\n" " -863 Use DOS code page 863 (French Canadian)\n" " -865 Use DOS code page 865 (Nordic)\n" " -7 Convert 8 bit characters to 7 bit space\n" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" " -f, --force force conversion of binary files\n" " -h, --help give this help\n" " -k, --keepdate keep output file date\n" " -L, --license display software license\n" " -l, --newline add additional newline\n" " -m, --add-bom add UTF-8 Byte Order Mark\n" " -n, --newfile write to new file\n" " infile original file in new file mode\n" " outfile output file in new file mode\n" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old file mode\n" " -q, --quiet quiet mode, suppress all warnings\n" " always on in stdio mode\n" " -s, --safe skip binary files (default)\n" msgstr "" "%s %s (%s)\n" "Aufruf: %s [Optionen] [Datei ...] [-n Eingabedatei Ausgabedatei ...]\n" " -ascii nur Zeilenumbrüche konvertieren (Vorgabe)\n" " -iso Konvertierung zwischen DOS und ISO-8859-1 " "Zeichensatz\n" " -1252 Windows Codepage 1252 verwenden (Westeuropäisch)\n" " -437 DOS Codepage 437 verwenden (US) (Vorgabe)\n" " -850 DOS Codepage 850 verwenden (Westeuropäisch)\n" " -860 DOS Codepage 860 verwenden (Portugiesisch)\n" " -863 DOS Codepage 863 verwenden (Kanadisches Französisch)\n" " -865 DOS Codepage 865 verwenden (Nordisch)\n" " -7 8Bit Zeichen in solche aus dem 7Bit Raum " "konvertieren\n" " -c, --convmode Konvertierungsmodus angeben\n" " convmode ascii, 7bit, iso, mac, Standard ist nach ascii\n" " -f, --force erzwingt die Umwandlung binärer Dateien\n" " -h, --help gibt diese Hilfe\n" " -k, --keepdate Datum der Ausgabedatei bleibt erhalten\n" " -L, --license Ausgabe der Software-Lizenz\n" " -l, --newline fügt einen Zeilenumbruch hinzu\n" " -m, --add-bom UTF-8 Byte Order Mark hinzufügen\n" " -n, --newfile eine neue Datei wird erzeugt\n" " Eingabedatei Originaldatei im neue Datei Modus\n" " Ausgabedatei Ausgabedatei im neue Datei Modus\n" " -o, --oldfile überschreibt die alte Datei (Vorgabe)\n" " Datei ... Die im alte Datei Modus zu konvertierenden Dateien\n" " -q, --quiet ruhiger Modus, unterdrückt alle Warnungen\n" " ist im stdio Modus immer aktiv\n" " -s, --safe überspringt binäre Dateien (Vorgabe)\n" #: common.c:225 #, c-format msgid "" " -ul, --assume-utf16le Assume that the input format is UTF-16LE\n" " -ub, --assume-utf16be Assume that the input format is UTF-16BE\n" msgstr "" " -ul, --assume-utf16le setze UTF-16LE als Eingabeformat voraus\n" " -ub, --assume-utf16be setze UTF-16BE als Eingabeformat voraus\n" #: common.c:230 #, c-format msgid "" " -F, --follow-symlink follow symbolic links and convert the targets\n" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" " -F, --follow-symlink folgt symbolischen Verknüpfungen und wandelt die " "Ziele um\n" " -R, --replace-symlink ersetzt symbolische Verknüpfungen durch die " "umgewandelten\n" " Dateien (die Originale Ziele bleiben unangetastet)\n" " -S, --skip-symlink symbolische Verknüpfungen und deren Ziele bleiben\n" " unangetastet (Vorgabe)\n" #: common.c:236 #, c-format msgid " -V, --version display version number\n" msgstr " -V, --version gibt die Versionsnummer aus\n" #: common.c:249 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16 bit Version (WATCOMC).\n" #: common.c:251 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16 bit Version (TURBOC).\n" #: common.c:253 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32 bit Version (WATCOMC).\n" #: common.c:255 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32 bit Version (DJGPP).\n" #: common.c:257 msgid "MSYS version.\n" msgstr "MSYS Version.\n" #: common.c:259 msgid "Cygwin version.\n" msgstr "Cygwin Version.\n" #: common.c:261 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64 bit Version (MinGW-w64).\n" #: common.c:263 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32 bit Version (WATCOMC).\n" #: common.c:265 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32 bit Version (MinGW-w64).\n" #: common.c:267 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32 bit Version (MinGW).\n" #: common.c:269 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64 bit Version (MSVC %d).\n" #: common.c:271 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32 bit Version (MSVC %d).\n" #: common.c:273 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2 Version (WATCOMC).\n" #: common.c:275 msgid "OS/2 version (EMX).\n" msgstr "OS/2 Version (EMX).\n" #: common.c:278 msgid "With Unicode UTF-16 support.\n" msgstr "Mit Unterstützung für Unicode UTF-16.\n" #: common.c:280 msgid "Without Unicode UTF-16 support.\n" msgstr "Ohne Unterstützung für Unicode UTF-16.\n" #: common.c:283 msgid "With native language support.\n" msgstr "Mit Unterstützung von Landessprachen.\n" dos2unix-6.0.4/po/dos2unix.pot0000644000175500010010000002375012245223471015471 0ustar waterlanGeen# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-26 23:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: dos2unix.c:76 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: dos2unix.c:164 dos2unix.c:202 unix2dos.c:132 unix2dos.c:185 #, c-format msgid "Binary symbol 0x00%02X found at line %d\n" msgstr "" #: dos2unix.c:179 dos2unix.c:218 dos2unix.c:243 dos2unix.c:355 dos2unix.c:391 #: dos2unix.c:413 unix2dos.c:162 unix2dos.c:199 unix2dos.c:220 unix2dos.c:238 #: unix2dos.c:362 unix2dos.c:396 unix2dos.c:414 unix2dos.c:429 #, c-format msgid "can not write to output file: %s\n" msgstr "" #: dos2unix.c:259 dos2unix.c:428 unix2dos.c:253 unix2dos.c:443 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "" #: dos2unix.c:317 unix2dos.c:311 #, c-format msgid "using code page %d.\n" msgstr "" #: dos2unix.c:342 dos2unix.c:377 unix2dos.c:334 unix2dos.c:384 #, c-format msgid "Binary symbol 0x%02X found at line %d\n" msgstr "" #: dos2unix.c:516 unix2dos.c:531 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "" #: dos2unix.c:523 unix2dos.c:538 #, c-format msgid "using %s as temporary file\n" msgstr "" #: dos2unix.c:636 unix2dos.c:651 #, c-format msgid "Failed to write to temporary output file %s: %s\n" msgstr "" #: dos2unix.c:671 unix2dos.c:686 #, c-format msgid "Failed to change the permissions of temporary output file %s: %s\n" msgstr "" #: dos2unix.c:690 unix2dos.c:705 #, c-format msgid "Failed to change the owner and group of temporary output file %s: %s\n" msgstr "" #: dos2unix.c:743 unix2dos.c:758 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "" #: dos2unix.c:744 dos2unix.c:778 unix2dos.c:759 unix2dos.c:793 #, c-format msgid " output file remains in '%s'\n" msgstr "" #: dos2unix.c:773 unix2dos.c:788 #, c-format msgid "problems renaming '%s' to '%s': %s\n" msgstr "" #: dos2unix.c:776 unix2dos.c:791 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr "" #: dos2unix.c:874 unix2dos.c:889 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "" #: dos2unix.c:977 dos2unix.c:1014 unix2dos.c:992 unix2dos.c:1029 #, c-format msgid "active code page: %d\n" msgstr "" #: dos2unix.c:1024 unix2dos.c:1039 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "" #: dos2unix.c:1034 unix2dos.c:1049 #, c-format msgid "option '%s' requires an argument\n" msgstr "" #: dos2unix.c:1047 dos2unix.c:1061 dos2unix.c:1255 unix2dos.c:1062 #: unix2dos.c:1076 unix2dos.c:1276 #, c-format msgid "target of file %s not specified in new file mode\n" msgstr "" #: dos2unix.c:1091 dos2unix.c:1175 unix2dos.c:1106 unix2dos.c:1193 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "" #: dos2unix.c:1098 unix2dos.c:1113 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "" #: dos2unix.c:1105 dos2unix.c:1189 unix2dos.c:1120 unix2dos.c:1207 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "" #: dos2unix.c:1112 unix2dos.c:1127 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "" #: dos2unix.c:1119 dos2unix.c:1196 unix2dos.c:1134 unix2dos.c:1214 #, c-format msgid "Skipping binary file %s\n" msgstr "" #: dos2unix.c:1126 dos2unix.c:1203 unix2dos.c:1141 unix2dos.c:1221 #, c-format msgid "code page %d is not supported.\n" msgstr "" #: dos2unix.c:1133 dos2unix.c:1210 unix2dos.c:1148 unix2dos.c:1228 #, c-format msgid "" "Skipping UTF-16 file %s, the current locale character encoding is not " "UTF-8.\n" msgstr "" #: dos2unix.c:1140 dos2unix.c:1217 unix2dos.c:1155 unix2dos.c:1235 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "" #: dos2unix.c:1147 dos2unix.c:1224 unix2dos.c:1162 unix2dos.c:1242 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n" msgstr "" #: dos2unix.c:1153 #, c-format msgid "converting file %s to file %s in Unix format ...\n" msgstr "" #: dos2unix.c:1160 unix2dos.c:1178 #, c-format msgid "problems converting file %s to file %s\n" msgstr "" #: dos2unix.c:1182 unix2dos.c:1200 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "" #: dos2unix.c:1230 #, c-format msgid "converting file %s to Unix format ...\n" msgstr "" #: dos2unix.c:1237 unix2dos.c:1258 #, c-format msgid "problems converting file %s\n" msgstr "" #: unix2dos.c:66 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: unix2dos.c:1169 #, c-format msgid "converting file %s to file %s in Mac format ...\n" msgstr "" #: unix2dos.c:1171 #, c-format msgid "converting file %s to file %s in DOS format ...\n" msgstr "" #: unix2dos.c:1249 #, c-format msgid "converting file %s to Mac format ...\n" msgstr "" #: unix2dos.c:1251 #, c-format msgid "converting file %s to DOS format ...\n" msgstr "" #: common.c:169 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" #: common.c:195 #, c-format msgid "" "%s %s (%s)\n" "Usage: %s [options] [file ...] [-n infile outfile ...]\n" " -ascii convert only line breaks (default)\n" " -iso conversion between DOS and ISO-8859-1 character set\n" " -1252 Use Windows code page 1252 (Western European)\n" " -437 Use DOS code page 437 (US) (default)\n" " -850 Use DOS code page 850 (Western European)\n" " -860 Use DOS code page 860 (Portuguese)\n" " -863 Use DOS code page 863 (French Canadian)\n" " -865 Use DOS code page 865 (Nordic)\n" " -7 Convert 8 bit characters to 7 bit space\n" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" " -f, --force force conversion of binary files\n" " -h, --help give this help\n" " -k, --keepdate keep output file date\n" " -L, --license display software license\n" " -l, --newline add additional newline\n" " -m, --add-bom add UTF-8 Byte Order Mark\n" " -n, --newfile write to new file\n" " infile original file in new file mode\n" " outfile output file in new file mode\n" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old file mode\n" " -q, --quiet quiet mode, suppress all warnings\n" " always on in stdio mode\n" " -s, --safe skip binary files (default)\n" msgstr "" #: common.c:225 #, c-format msgid "" " -ul, --assume-utf16le Assume that the input format is UTF-16LE\n" " -ub, --assume-utf16be Assume that the input format is UTF-16BE\n" msgstr "" #: common.c:230 #, c-format msgid "" " -F, --follow-symlink follow symbolic links and convert the targets\n" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" #: common.c:236 #, c-format msgid " -V, --version display version number\n" msgstr "" #: common.c:249 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "" #: common.c:251 msgid "DOS 16 bit version (TURBOC).\n" msgstr "" #: common.c:253 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "" #: common.c:255 msgid "DOS 32 bit version (DJGPP).\n" msgstr "" #: common.c:257 msgid "MSYS version.\n" msgstr "" #: common.c:259 msgid "Cygwin version.\n" msgstr "" #: common.c:261 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "" #: common.c:263 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "" #: common.c:265 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "" #: common.c:267 msgid "Windows 32 bit version (MinGW).\n" msgstr "" #: common.c:269 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "" #: common.c:271 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "" #: common.c:273 msgid "OS/2 version (WATCOMC).\n" msgstr "" #: common.c:275 msgid "OS/2 version (EMX).\n" msgstr "" #: common.c:278 msgid "With Unicode UTF-16 support.\n" msgstr "" #: common.c:280 msgid "Without Unicode UTF-16 support.\n" msgstr "" #: common.c:283 msgid "With native language support.\n" msgstr "" dos2unix-6.0.4/po/eo-x.po0000644000175500010010000003457412245223471014410 0ustar waterlanGeen# Esperanto translations for dos2unix package. # Copyright (C) 2009-2012 THE dos2unix's COPYRIGHT HOLDER # This file is distributed under the same license as the dos2unix package. # waterlan , 2009-2012. # msgid "" msgstr "" "Project-Id-Version: dos2unix 5.3.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-26 23:08+-0100\n" "PO-Revision-Date: 2010-03-07 19:50+-0100\n" "Last-Translator: Rugxulo \n" "Language-Team: Esperanto \n" "Language: eo\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: dos2unix.c:76 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: dos2unix.c:164 dos2unix.c:202 unix2dos.c:132 unix2dos.c:185 #, c-format msgid "Binary symbol 0x00%02X found at line %d\n" msgstr "Netekstan signon 0x00%02X trovigxis cxe linio %d\n" #: dos2unix.c:179 dos2unix.c:218 dos2unix.c:243 dos2unix.c:355 dos2unix.c:391 #: dos2unix.c:413 unix2dos.c:162 unix2dos.c:199 unix2dos.c:220 unix2dos.c:238 #: unix2dos.c:362 unix2dos.c:396 unix2dos.c:414 unix2dos.c:429 #, c-format msgid "can not write to output file: %s\n" msgstr "ne povas registri dosieren: %s\n" #: dos2unix.c:259 dos2unix.c:428 unix2dos.c:253 unix2dos.c:443 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "programa eraro, negxustan sxangxmodon %d\n" #: dos2unix.c:317 unix2dos.c:311 #, c-format msgid "using code page %d.\n" msgstr "uzante kodpagxon %d.\n" #: dos2unix.c:342 dos2unix.c:377 unix2dos.c:334 unix2dos.c:384 #, c-format msgid "Binary symbol 0x%02X found at line %d\n" msgstr "Netekstan signon 0x%02X trovigxis cxe linio %d\n" #: dos2unix.c:516 unix2dos.c:531 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "malsukcesis malfermi provizoran dosieron registran: %s\n" #: dos2unix.c:523 unix2dos.c:538 #, c-format msgid "using %s as temporary file\n" msgstr "uzante %s kiel provizora dosiero\n" #: dos2unix.c:636 unix2dos.c:651 #, c-format msgid "Failed to write to temporary output file %s: %s\n" msgstr "Ne sukcesis registri provizoran eligitan dosieron %s: %s\n" #: dos2unix.c:671 unix2dos.c:686 #, c-format msgid "Failed to change the permissions of temporary output file %s: %s\n" msgstr "" "Malsukcesis sxangxi la permesajxojn de la provizora eldona dosiero %s: %s\n" #: dos2unix.c:690 unix2dos.c:705 #, c-format msgid "Failed to change the owner and group of temporary output file %s: %s\n" msgstr "" "Malsukcesis sxangxi la proprietulon kaj grupon de la provizora eldona dosiero " "%s: %s\n" #: dos2unix.c:743 unix2dos.c:758 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "erarojn legante dosieran cxeneron '%s'\n" #: dos2unix.c:744 dos2unix.c:778 unix2dos.c:759 unix2dos.c:793 #, c-format msgid " output file remains in '%s'\n" msgstr " kreatan dosieron restas en '%s'\n" #: dos2unix.c:773 unix2dos.c:788 #, c-format msgid "problems renaming '%s' to '%s': %s\n" msgstr "problemojn trovitajn renomigi '%s' al '%s': %s\n" #: dos2unix.c:776 unix2dos.c:791 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " kiu estas la atingon de dosiera cxenero '%s'\n" #: dos2unix.c:874 unix2dos.c:889 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "eraro: DOS2UNIX_LOCALEDIR tro longigxis.\n" #: dos2unix.c:977 dos2unix.c:1014 unix2dos.c:992 unix2dos.c:1029 #, c-format msgid "active code page: %d\n" msgstr "nuntempa kodpagxo: %d\n" #: dos2unix.c:1024 unix2dos.c:1039 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "neuzebla %s sxangxmodo menciita\n" #: dos2unix.c:1034 unix2dos.c:1049 #, c-format msgid "option '%s' requires an argument\n" msgstr "elekto '%s' bezonas elekto-vorton\n" #: dos2unix.c:1047 dos2unix.c:1061 dos2unix.c:1255 unix2dos.c:1062 #: unix2dos.c:1076 unix2dos.c:1276 #, c-format msgid "target of file %s not specified in new file mode\n" msgstr "ejon de dosiero %s ne menciita en novmodo dosiera\n" #: dos2unix.c:1091 dos2unix.c:1175 unix2dos.c:1106 unix2dos.c:1193 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Pasante %s, dosiero ne taugxa.\n" #: dos2unix.c:1098 unix2dos.c:1113 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Evitante %s, atingan dosieron %s jam estas dosiera cxenero.\n" #: dos2unix.c:1105 dos2unix.c:1189 unix2dos.c:1120 unix2dos.c:1207 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Evitante dosieran cxeneron %s, atingon ne estas normala dosiero.\n" #: dos2unix.c:1112 unix2dos.c:1127 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Evitante %s, atingon de dosiera cxenero %s ne estas normala dosiero.\n" #: dos2unix.c:1119 dos2unix.c:1196 unix2dos.c:1134 unix2dos.c:1214 #, c-format msgid "Skipping binary file %s\n" msgstr "Pasante ne-tekstan dosieron %s\n" #: dos2unix.c:1126 dos2unix.c:1203 unix2dos.c:1141 unix2dos.c:1221 #, c-format msgid "code page %d is not supported.\n" msgstr "kodpagxo %d ne estas konvertebla.\n" #: dos2unix.c:1133 dos2unix.c:1210 unix2dos.c:1148 unix2dos.c:1228 #, c-format msgid "" "Skipping UTF-16 file %s, the current locale character encoding is not " "UTF-8.\n" msgstr "" "Evitante UTF-16 dosieron %s, la nuntempa lingvo-loka litero-enkodigxo ne " "egalas UTF-8.\n" #: dos2unix.c:1140 dos2unix.c:1217 unix2dos.c:1155 unix2dos.c:1235 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Evitante UTF-16 dosieron %s, la mezuro da wchar_t estas %d okopoj.\n" #: dos2unix.c:1147 dos2unix.c:1224 unix2dos.c:1162 unix2dos.c:1242 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n" msgstr "Evitante UTF-16 dosieron %s, eraro de UTF-16 tradukigxo okazis.\n" #: dos2unix.c:1153 #, c-format msgid "converting file %s to file %s in Unix format ...\n" msgstr "sxangxante dosieron %s al dosiero %s Unix-en ...\n" #: dos2unix.c:1160 unix2dos.c:1178 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problemojn trovitajn dum sxangxi dosiero %s al dosiero %s\n" #: dos2unix.c:1182 unix2dos.c:1200 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Evitante dosieran cxeneron %s.\n" #: dos2unix.c:1230 #, c-format msgid "converting file %s to Unix format ...\n" msgstr "sxangxante dosiero %s Unix-en ...\n" #: dos2unix.c:1237 unix2dos.c:1258 #, c-format msgid "problems converting file %s\n" msgstr "problemojn dum sxangxi dosiero %s\n" #: unix2dos.c:66 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: unix2dos.c:1169 #, c-format msgid "converting file %s to file %s in Mac format ...\n" msgstr "sxangxante dosiero %s al dosiero %s Mac-en ...\n" #: unix2dos.c:1171 #, c-format msgid "converting file %s to file %s in DOS format ...\n" msgstr "sxangxante dosiero %s al dosiero %s DOS-en ...\n" #: unix2dos.c:1249 #, c-format msgid "converting file %s to Mac format ...\n" msgstr "sxangxante dosiero %s Mac-en ...\n" #: unix2dos.c:1251 #, c-format msgid "converting file %s to DOS format ...\n" msgstr "sxangxante dosiero %s DOS-en ...\n" #: common.c:169 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" #: common.c:195 #, c-format msgid "" "%s %s (%s)\n" "Usage: %s [options] [file ...] [-n infile outfile ...]\n" " -ascii convert only line breaks (default)\n" " -iso conversion between DOS and ISO-8859-1 character set\n" " -1252 Use Windows code page 1252 (Western European)\n" " -437 Use DOS code page 437 (US) (default)\n" " -850 Use DOS code page 850 (Western European)\n" " -860 Use DOS code page 860 (Portuguese)\n" " -863 Use DOS code page 863 (French Canadian)\n" " -865 Use DOS code page 865 (Nordic)\n" " -7 Convert 8 bit characters to 7 bit space\n" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" " -f, --force force conversion of binary files\n" " -h, --help give this help\n" " -k, --keepdate keep output file date\n" " -L, --license display software license\n" " -l, --newline add additional newline\n" " -m, --add-bom add UTF-8 Byte Order Mark\n" " -n, --newfile write to new file\n" " infile original file in new file mode\n" " outfile output file in new file mode\n" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old file mode\n" " -q, --quiet quiet mode, suppress all warnings\n" " always on in stdio mode\n" " -s, --safe skip binary files (default)\n" msgstr "" "%s %s (%s)\n" "Uzado: %s [elektojn] [dosiero ...] [-n antauxajxo kreajxo ...]\n" " -ascii nur traduku linio-finojn (jam ensxaltita)\n" " -iso traduku inter DOS kaj ISO-8859-1 literaro\n" " -1252 Uzu Vindozan kodpagxon 1252 (Okcident-Euxropa)\n" " -437 Uzu DOS kodpagxon 437 (Usona) (jam ensxaltita)\n" " -850 Uzu DOS kodpagxon 850 (Okcident-Euxropa)\n" " -860 Uzu DOS kodpagxon 860 (Portugala)\n" " -863 Uzu DOS kodpagxon 863 (Kebekia)\n" " -865 Uzu DOS kodpagxon 865 (Nordlandaj)\n" " -7 Traduku de 8-bitaj literoj en blankspacon\n" " -c, --convmode modo de sxangxo\n" " sxangxmodo ascii, 7bit, iso, mac, provizore elektita ascii\n" " -f, --force forte konvertado de netekstaj dosieroj\n" " -h, --help diri cxi tiun mesagxon\n" " -k, --keepdate konservi dato-tempon dosieran\n" " -L, --license eldiru permesilon tekstan\n" " -l, --newline aldoni markon linian finan\n" " -m, --aldoni-bom aldoni UTF-8 internan ordo-markon\n" " -n, --newfile registri novan dosieron\n" " antauxajxo al antauxa dosiero metita novmoden\n" " kreajxo al dosiero registrita novmoden\n" " -o, --oldfile registri malnovan dosieron (jam sxaltita)\n" " dosiero... dosiero(j)n por registri per malnova modo\n" " -q, --quiet silente eviti avertojn\n" " cxiam ensxaltata dum stdio modo\n" " -s, --safe evitu netekstajn dosierojn (jam sxaltita)\n" #: common.c:225 #, c-format msgid "" " -ul, --assume-utf16le Assume that the input format is UTF-16LE\n" " -ub, --assume-utf16be Assume that the input format is UTF-16BE\n" msgstr "" " -ul, --assume-utf16le trakti enmeton kvazaux UTF-16LE\n" " -ub, --assume-utf16be trakti enmeton kvazaux UTF-16BE\n" #: common.c:230 #, c-format msgid "" " -F, --follow-symlink follow symbolic links and convert the targets\n" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" " -F, --follow-symlink legu dosierajn cxenerojn kaj konverti la atingojn\n" " -R, --replace-symlink anstatauxe registru dosierajn cxenerojn per konvertotaj " "dosieroj\n" " (ne-cxeneraj atingaj dosieroj restas nesxangxitaj)\n" " -S, --skip-symlink retenu dosierajn cxenerojn kaj atingojn nesxangxataj " "(jam sxaltita)\n" #: common.c:236 #, c-format msgid " -V, --version display version number\n" msgstr " -V, --version diri eldono-numeron\n" #: common.c:249 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS-16 eldono (WATCOMC).\n" #: common.c:251 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS-16 eldono (TURBOC).\n" #: common.c:253 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS-32 eldono (WATCOMC).\n" #: common.c:255 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS-32 eldono (DJGPP).\n" #: common.c:257 msgid "MSYS version.\n" msgstr "MSYS eldono.\n" #: common.c:259 msgid "Cygwin version.\n" msgstr "Cygwin eldono.\n" #: common.c:261 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows-64 eldono (MinGW-w64).\n" #: common.c:263 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows-32 eldono (WATCOMC).\n" #: common.c:265 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows-32 eldono (MinGW-w64).\n" #: common.c:267 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows-32 eldono (MinGW).\n" #: common.c:269 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows-64 eldono (MSVC %d).\n" #: common.c:271 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows-32 eldono (MSVC %d).\n" #: common.c:273 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2 eldono (WATCOMC).\n" #: common.c:275 msgid "OS/2 version (EMX).\n" msgstr "OS/2 eldono (EMX).\n" #: common.c:278 msgid "With Unicode UTF-16 support.\n" msgstr "Kun subteno de Unikodo da UTF-16.\n" #: common.c:280 msgid "Without Unicode UTF-16 support.\n" msgstr "Sen subteno de Unikodo da UTF-16.\n" #: common.c:283 msgid "With native language support.\n" msgstr "Uzante denaskan lingvon sistemon.\n" dos2unix-6.0.4/po/eo.po0000644000175500010010000003457212245223471014141 0ustar waterlanGeen# Esperanto translations for dos2unix package. # Copyright (C) 2009-2012 THE dos2unix's COPYRIGHT HOLDER # This file is distributed under the same license as the dos2unix package. # waterlan , 2009-2012. # msgid "" msgstr "" "Project-Id-Version: dos2unix 5.3.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-26 23:08+0100\n" "PO-Revision-Date: 2010-03-07 19:50+0100\n" "Last-Translator: Ruĝulo \n" "Language-Team: Esperanto \n" "Language: eo\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: dos2unix.c:76 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: dos2unix.c:164 dos2unix.c:202 unix2dos.c:132 unix2dos.c:185 #, c-format msgid "Binary symbol 0x00%02X found at line %d\n" msgstr "Netekstan signon 0x00%02X troviĝis ĉe linio %d\n" #: dos2unix.c:179 dos2unix.c:218 dos2unix.c:243 dos2unix.c:355 dos2unix.c:391 #: dos2unix.c:413 unix2dos.c:162 unix2dos.c:199 unix2dos.c:220 unix2dos.c:238 #: unix2dos.c:362 unix2dos.c:396 unix2dos.c:414 unix2dos.c:429 #, c-format msgid "can not write to output file: %s\n" msgstr "ne povas registri dosieren: %s\n" #: dos2unix.c:259 dos2unix.c:428 unix2dos.c:253 unix2dos.c:443 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "programa eraro, neĝustan ŝanĝmodon %d\n" #: dos2unix.c:317 unix2dos.c:311 #, c-format msgid "using code page %d.\n" msgstr "uzante kodpaĝon %d.\n" #: dos2unix.c:342 dos2unix.c:377 unix2dos.c:334 unix2dos.c:384 #, c-format msgid "Binary symbol 0x%02X found at line %d\n" msgstr "Netekstan signon 0x%02X troviĝis ĉe linio %d\n" #: dos2unix.c:516 unix2dos.c:531 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "malsukcesis malfermi provizoran dosieron registran: %s\n" #: dos2unix.c:523 unix2dos.c:538 #, c-format msgid "using %s as temporary file\n" msgstr "uzante %s kiel provizora dosiero\n" #: dos2unix.c:636 unix2dos.c:651 #, c-format msgid "Failed to write to temporary output file %s: %s\n" msgstr "Ne sukcesis registri provizoran eligitan dosieron %s: %s\n" #: dos2unix.c:671 unix2dos.c:686 #, c-format msgid "Failed to change the permissions of temporary output file %s: %s\n" msgstr "" "Malsukcesis ŝanĝi la permesaĵojn de la provizora eldona dosiero %s: %s\n" #: dos2unix.c:690 unix2dos.c:705 #, c-format msgid "Failed to change the owner and group of temporary output file %s: %s\n" msgstr "" "Malsukcesis ŝanĝi la proprietulon kaj grupon de la provizora eldona dosiero " "%s: %s\n" #: dos2unix.c:743 unix2dos.c:758 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "erarojn legante dosieran ĉeneron '%s'\n" #: dos2unix.c:744 dos2unix.c:778 unix2dos.c:759 unix2dos.c:793 #, c-format msgid " output file remains in '%s'\n" msgstr " kreatan dosieron restas en '%s'\n" #: dos2unix.c:773 unix2dos.c:788 #, c-format msgid "problems renaming '%s' to '%s': %s\n" msgstr "problemojn trovitajn renomigi '%s' al '%s': %s\n" #: dos2unix.c:776 unix2dos.c:791 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " kiu estas la atingon de dosiera ĉenero '%s'\n" #: dos2unix.c:874 unix2dos.c:889 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "eraro: DOS2UNIX_LOCALEDIR tro longiĝis.\n" #: dos2unix.c:977 dos2unix.c:1014 unix2dos.c:992 unix2dos.c:1029 #, c-format msgid "active code page: %d\n" msgstr "nuntempa kodpaĝo: %d\n" #: dos2unix.c:1024 unix2dos.c:1039 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "neuzebla %s ŝanĝmodo menciita\n" #: dos2unix.c:1034 unix2dos.c:1049 #, c-format msgid "option '%s' requires an argument\n" msgstr "elekto '%s' bezonas elekto-vorton\n" #: dos2unix.c:1047 dos2unix.c:1061 dos2unix.c:1255 unix2dos.c:1062 #: unix2dos.c:1076 unix2dos.c:1276 #, c-format msgid "target of file %s not specified in new file mode\n" msgstr "ejon de dosiero %s ne menciita en novmodo dosiera\n" #: dos2unix.c:1091 dos2unix.c:1175 unix2dos.c:1106 unix2dos.c:1193 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Pasante %s, dosiero ne tauĝa.\n" #: dos2unix.c:1098 unix2dos.c:1113 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Evitante %s, atingan dosieron %s jam estas dosiera ĉenero.\n" #: dos2unix.c:1105 dos2unix.c:1189 unix2dos.c:1120 unix2dos.c:1207 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Evitante dosieran ĉeneron %s, atingon ne estas normala dosiero.\n" #: dos2unix.c:1112 unix2dos.c:1127 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Evitante %s, atingon de dosiera ĉenero %s ne estas normala dosiero.\n" #: dos2unix.c:1119 dos2unix.c:1196 unix2dos.c:1134 unix2dos.c:1214 #, c-format msgid "Skipping binary file %s\n" msgstr "Pasante ne-tekstan dosieron %s\n" #: dos2unix.c:1126 dos2unix.c:1203 unix2dos.c:1141 unix2dos.c:1221 #, c-format msgid "code page %d is not supported.\n" msgstr "kodpaĝo %d ne estas konvertebla.\n" #: dos2unix.c:1133 dos2unix.c:1210 unix2dos.c:1148 unix2dos.c:1228 #, c-format msgid "" "Skipping UTF-16 file %s, the current locale character encoding is not " "UTF-8.\n" msgstr "" "Evitante UTF-16 dosieron %s, la nuntempa lingvo-loka litero-enkodiĝo ne " "egalas UTF-8.\n" #: dos2unix.c:1140 dos2unix.c:1217 unix2dos.c:1155 unix2dos.c:1235 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Evitante UTF-16 dosieron %s, la mezuro da wchar_t estas %d okopoj.\n" #: dos2unix.c:1147 dos2unix.c:1224 unix2dos.c:1162 unix2dos.c:1242 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n" msgstr "Evitante UTF-16 dosieron %s, eraro de UTF-16 tradukiĝo okazis.\n" #: dos2unix.c:1153 #, c-format msgid "converting file %s to file %s in Unix format ...\n" msgstr "ŝanĝante dosieron %s al dosiero %s Unix-en ...\n" #: dos2unix.c:1160 unix2dos.c:1178 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problemojn trovitajn dum ŝanĝi dosiero %s al dosiero %s\n" #: dos2unix.c:1182 unix2dos.c:1200 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Evitante dosieran ĉeneron %s.\n" #: dos2unix.c:1230 #, c-format msgid "converting file %s to Unix format ...\n" msgstr "ŝanĝante dosiero %s Unix-en ...\n" #: dos2unix.c:1237 unix2dos.c:1258 #, c-format msgid "problems converting file %s\n" msgstr "problemojn dum ŝanĝi dosiero %s\n" #: unix2dos.c:66 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: unix2dos.c:1169 #, c-format msgid "converting file %s to file %s in Mac format ...\n" msgstr "ŝanĝante dosiero %s al dosiero %s Mac-en ...\n" #: unix2dos.c:1171 #, c-format msgid "converting file %s to file %s in DOS format ...\n" msgstr "ŝanĝante dosiero %s al dosiero %s DOS-en ...\n" #: unix2dos.c:1249 #, c-format msgid "converting file %s to Mac format ...\n" msgstr "ŝanĝante dosiero %s Mac-en ...\n" #: unix2dos.c:1251 #, c-format msgid "converting file %s to DOS format ...\n" msgstr "ŝanĝante dosiero %s DOS-en ...\n" #: common.c:169 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" #: common.c:195 #, c-format msgid "" "%s %s (%s)\n" "Usage: %s [options] [file ...] [-n infile outfile ...]\n" " -ascii convert only line breaks (default)\n" " -iso conversion between DOS and ISO-8859-1 character set\n" " -1252 Use Windows code page 1252 (Western European)\n" " -437 Use DOS code page 437 (US) (default)\n" " -850 Use DOS code page 850 (Western European)\n" " -860 Use DOS code page 860 (Portuguese)\n" " -863 Use DOS code page 863 (French Canadian)\n" " -865 Use DOS code page 865 (Nordic)\n" " -7 Convert 8 bit characters to 7 bit space\n" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" " -f, --force force conversion of binary files\n" " -h, --help give this help\n" " -k, --keepdate keep output file date\n" " -L, --license display software license\n" " -l, --newline add additional newline\n" " -m, --add-bom add UTF-8 Byte Order Mark\n" " -n, --newfile write to new file\n" " infile original file in new file mode\n" " outfile output file in new file mode\n" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old file mode\n" " -q, --quiet quiet mode, suppress all warnings\n" " always on in stdio mode\n" " -s, --safe skip binary files (default)\n" msgstr "" "%s %s (%s)\n" "Uzado: %s [elektojn] [dosiero ...] [-n antaŭaĵo kreaĵo ...]\n" " -ascii nur traduku linio-finojn (jam enŝaltita)\n" " -iso traduku inter DOS kaj ISO-8859-1 literaro\n" " -1252 Uzu Vindozan kodpaĝon 1252 (Okcident-Eŭropa)\n" " -437 Uzu DOS kodpaĝon 437 (Usona) (jam enŝaltita)\n" " -850 Uzu DOS kodpaĝon 850 (Okcident-Eŭropa)\n" " -860 Uzu DOS kodpaĝon 860 (Portugala)\n" " -863 Uzu DOS kodpaĝon 863 (Kebekia)\n" " -865 Uzu DOS kodpaĝon 865 (Nordlandaj)\n" " -7 Traduku de 8-bitaj literoj en blankspacon\n" " -c, --convmode modo de ŝanĝo\n" " ŝanĝmodo ascii, 7bit, iso, mac, provizore elektita ascii\n" " -f, --force forte konvertado de netekstaj dosieroj\n" " -h, --help diri ĉi tiun mesaĝon\n" " -k, --keepdate konservi dato-tempon dosieran\n" " -L, --license eldiru permesilon tekstan\n" " -l, --newline aldoni markon linian finan\n" " -m, --aldoni-bom aldoni UTF-8 internan ordo-markon\n" " -n, --newfile registri novan dosieron\n" " antaŭaĵo al antaŭa dosiero metita novmoden\n" " kreaĵo al dosiero registrita novmoden\n" " -o, --oldfile registri malnovan dosieron (jam ŝaltita)\n" " dosiero... dosiero(j)n por registri per malnova modo\n" " -q, --quiet silente eviti avertojn\n" " ĉiam enŝaltata dum stdio modo\n" " -s, --safe evitu netekstajn dosierojn (jam ŝaltita)\n" #: common.c:225 #, c-format msgid "" " -ul, --assume-utf16le Assume that the input format is UTF-16LE\n" " -ub, --assume-utf16be Assume that the input format is UTF-16BE\n" msgstr "" " -ul, --assume-utf16le trakti enmeton kvazaŭ UTF-16LE\n" " -ub, --assume-utf16be trakti enmeton kvazaŭ UTF-16BE\n" #: common.c:230 #, c-format msgid "" " -F, --follow-symlink follow symbolic links and convert the targets\n" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" " -F, --follow-symlink legu dosierajn ĉenerojn kaj konverti la atingojn\n" " -R, --replace-symlink anstataŭe registru dosierajn ĉenerojn per konvertotaj " "dosieroj\n" " (ne-ĉeneraj atingaj dosieroj restas neŝanĝitaj)\n" " -S, --skip-symlink retenu dosierajn ĉenerojn kaj atingojn neŝanĝataj " "(jam ŝaltita)\n" #: common.c:236 #, c-format msgid " -V, --version display version number\n" msgstr " -V, --version diri eldono-numeron\n" #: common.c:249 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS-16 eldono (WATCOMC).\n" #: common.c:251 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS-16 eldono (TURBOC).\n" #: common.c:253 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS-32 eldono (WATCOMC).\n" #: common.c:255 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS-32 eldono (DJGPP).\n" #: common.c:257 msgid "MSYS version.\n" msgstr "MSYS eldono.\n" #: common.c:259 msgid "Cygwin version.\n" msgstr "Cygwin eldono.\n" #: common.c:261 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows-64 eldono (MinGW-w64).\n" #: common.c:263 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows-32 eldono (WATCOMC).\n" #: common.c:265 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows-32 eldono (MinGW-w64).\n" #: common.c:267 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows-32 eldono (MinGW).\n" #: common.c:269 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows-64 eldono (MSVC %d).\n" #: common.c:271 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows-32 eldono (MSVC %d).\n" #: common.c:273 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2 eldono (WATCOMC).\n" #: common.c:275 msgid "OS/2 version (EMX).\n" msgstr "OS/2 eldono (EMX).\n" #: common.c:278 msgid "With Unicode UTF-16 support.\n" msgstr "Kun subteno de Unikodo da UTF-16.\n" #: common.c:280 msgid "Without Unicode UTF-16 support.\n" msgstr "Sen subteno de Unikodo da UTF-16.\n" #: common.c:283 msgid "With native language support.\n" msgstr "Uzante denaskan lingvon sistemon.\n" dos2unix-6.0.4/po/es.po0000644000175500010010000003552612245223471014145 0ustar waterlanGeen# Spanish translations for dos2unix package # Traducciones al espaol para el paquete dos2unix. # Copyright (C) 2011,2012 THE dos2unix'S COPYRIGHT HOLDER # This file is distributed under the same license as the dos2unix package. # Julio A. Freyre-Gonzalez , 2011,2012. # msgid "" msgstr "" "Project-Id-Version: dos2unix\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-26 23:08+0100\n" "PO-Revision-Date: 2011-06-20 09:13+0200\n" "Last-Translator: \n" "Language-Team: Spanish\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: dos2unix.c:76 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: dos2unix.c:164 dos2unix.c:202 unix2dos.c:132 unix2dos.c:185 #, c-format msgid "Binary symbol 0x00%02X found at line %d\n" msgstr "Smbolo binario 0x00%02X encontrado en la lnea %d\n" #: dos2unix.c:179 dos2unix.c:218 dos2unix.c:243 dos2unix.c:355 dos2unix.c:391 #: dos2unix.c:413 unix2dos.c:162 unix2dos.c:199 unix2dos.c:220 unix2dos.c:238 #: unix2dos.c:362 unix2dos.c:396 unix2dos.c:414 unix2dos.c:429 #, c-format msgid "can not write to output file: %s\n" msgstr "no puedo escribir al archivo de salida: %s\n" #: dos2unix.c:259 dos2unix.c:428 unix2dos.c:253 unix2dos.c:443 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "error, modo de conversin %d invlido\n" #: dos2unix.c:317 unix2dos.c:311 #, c-format msgid "using code page %d.\n" msgstr "usando pgina de cdigos %d.\n" #: dos2unix.c:342 dos2unix.c:377 unix2dos.c:334 unix2dos.c:384 #, c-format msgid "Binary symbol 0x%02X found at line %d\n" msgstr "Smbolo binario 0x%02X encontrado en la lnea %d\n" #: dos2unix.c:516 unix2dos.c:531 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Fall al abrir el archivo de salida temporal: %s\n" #: dos2unix.c:523 unix2dos.c:538 #, c-format msgid "using %s as temporary file\n" msgstr "usando %s como archivo temporal\n" #: dos2unix.c:636 unix2dos.c:651 #, c-format msgid "Failed to write to temporary output file %s: %s\n" msgstr "Fall al escribir el archivo de salida temporal %s: %s\n" #: dos2unix.c:671 unix2dos.c:686 #, c-format msgid "Failed to change the permissions of temporary output file %s: %s\n" msgstr "Error al cambiar los permisos del archivo temporal de salida %s: %s\n" #: dos2unix.c:690 unix2dos.c:705 #, c-format msgid "Failed to change the owner and group of temporary output file %s: %s\n" msgstr "" "Error al cambiar el propietario y grupo del archivo temporal de salida %s: " "%s\n" #: dos2unix.c:743 unix2dos.c:758 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "problemas al resolver el enlace simblico '%s'\n" #: dos2unix.c:744 dos2unix.c:778 unix2dos.c:759 unix2dos.c:793 #, c-format msgid " output file remains in '%s'\n" msgstr " el archivo de salida permanece en '%s'\n" #: dos2unix.c:773 unix2dos.c:788 #, c-format msgid "problems renaming '%s' to '%s': %s\n" msgstr "problemas al renombrar '%s' como '%s': %s\n" #: dos2unix.c:776 unix2dos.c:791 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " cual es el destino del enlace simblico '%s'\n" #: dos2unix.c:874 unix2dos.c:889 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "" "error: El valor de la variable de entorno DOS2UNIX_LOCALEDIR es demasiado " "largo.\n" #: dos2unix.c:977 dos2unix.c:1014 unix2dos.c:992 unix2dos.c:1029 #, c-format msgid "active code page: %d\n" msgstr "Pgina de cdigos activa: %d\n" #: dos2unix.c:1024 unix2dos.c:1039 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "modo de conversin %s especificado es invlido\n" #: dos2unix.c:1034 unix2dos.c:1049 #, c-format msgid "option '%s' requires an argument\n" msgstr "el parmetro '%s' requiere un argumento\n" #: dos2unix.c:1047 dos2unix.c:1061 dos2unix.c:1255 unix2dos.c:1062 #: unix2dos.c:1076 unix2dos.c:1276 #, c-format msgid "target of file %s not specified in new file mode\n" msgstr "" "el destino del archivo %s no se especific en el modo de archivo nuevo\n" #: dos2unix.c:1091 dos2unix.c:1175 unix2dos.c:1106 unix2dos.c:1193 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Ignorando %s, no es un archivo regular.\n" #: dos2unix.c:1098 unix2dos.c:1113 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Ignorando %s, el archivo de salida %s es un enlace simblico.\n" #: dos2unix.c:1105 dos2unix.c:1189 unix2dos.c:1120 unix2dos.c:1207 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Ignorando enlace simblico %s, el destino no es un archivo regular.\n" #: dos2unix.c:1112 unix2dos.c:1127 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "" "Ignorando %s, el destino del enlace simblico %s no es un archivo regular.\n" #: dos2unix.c:1119 dos2unix.c:1196 unix2dos.c:1134 unix2dos.c:1214 #, c-format msgid "Skipping binary file %s\n" msgstr "Ignorando archivo binario %s\n" #: dos2unix.c:1126 dos2unix.c:1203 unix2dos.c:1141 unix2dos.c:1221 #, c-format msgid "code page %d is not supported.\n" msgstr "La pgina de cdigos %d no est soportada.\n" #: dos2unix.c:1133 dos2unix.c:1210 unix2dos.c:1148 unix2dos.c:1228 #, c-format msgid "" "Skipping UTF-16 file %s, the current locale character encoding is not " "UTF-8.\n" msgstr "Ignorando archivo UTF-16 %s, la codificacin actual no es UTF-8.\n" #: dos2unix.c:1140 dos2unix.c:1217 unix2dos.c:1155 unix2dos.c:1235 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Ignorando archivo UTF-16 %s, el tamao de wchar_t es %d bytes.\n" #: dos2unix.c:1147 dos2unix.c:1224 unix2dos.c:1162 unix2dos.c:1242 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n" msgstr "" "Ignorando archivo UTF-16 %s, ocurri un error de conversin a UTF-16.\n" #: dos2unix.c:1153 #, c-format msgid "converting file %s to file %s in Unix format ...\n" msgstr "convirtiendo archivo %s a %s in formato Unix ...\n" #: dos2unix.c:1160 unix2dos.c:1178 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problemas al convertir el archivo %s a %s\n" #: dos2unix.c:1182 unix2dos.c:1200 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Ignorando enlace simblico %s.\n" #: dos2unix.c:1230 #, c-format msgid "converting file %s to Unix format ...\n" msgstr "convirtiendo archivo %s a formato Unix ...\n" #: dos2unix.c:1237 unix2dos.c:1258 #, c-format msgid "problems converting file %s\n" msgstr "problemas convirtiendo el archivo %s\n" #: unix2dos.c:66 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: unix2dos.c:1169 #, c-format msgid "converting file %s to file %s in Mac format ...\n" msgstr "convirtiendo archivo %s a %s in formato Mac ...\n" #: unix2dos.c:1171 #, c-format msgid "converting file %s to file %s in DOS format ...\n" msgstr "convirtiendo archivo %s a %s en formato DOS ...\n" #: unix2dos.c:1249 #, c-format msgid "converting file %s to Mac format ...\n" msgstr "convirtiendo archivo %s a formato Mac ...\n" #: unix2dos.c:1251 #, c-format msgid "converting file %s to DOS format ...\n" msgstr "convirtiendo archivo %s a formato DOS ...\n" #: common.c:169 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" #: common.c:195 #, c-format msgid "" "%s %s (%s)\n" "Usage: %s [options] [file ...] [-n infile outfile ...]\n" " -ascii convert only line breaks (default)\n" " -iso conversion between DOS and ISO-8859-1 character set\n" " -1252 Use Windows code page 1252 (Western European)\n" " -437 Use DOS code page 437 (US) (default)\n" " -850 Use DOS code page 850 (Western European)\n" " -860 Use DOS code page 860 (Portuguese)\n" " -863 Use DOS code page 863 (French Canadian)\n" " -865 Use DOS code page 865 (Nordic)\n" " -7 Convert 8 bit characters to 7 bit space\n" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" " -f, --force force conversion of binary files\n" " -h, --help give this help\n" " -k, --keepdate keep output file date\n" " -L, --license display software license\n" " -l, --newline add additional newline\n" " -m, --add-bom add UTF-8 Byte Order Mark\n" " -n, --newfile write to new file\n" " infile original file in new file mode\n" " outfile output file in new file mode\n" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old file mode\n" " -q, --quiet quiet mode, suppress all warnings\n" " always on in stdio mode\n" " -s, --safe skip binary files (default)\n" msgstr "" "%s %s (%s)\n" "Uso: %s [parmetros] [archivo ...] [-n archivo_de_entrada " "archivo_de_salida ...]\n" " -ascii solamente convierte los saltos de lnea (por " "defecto)\n" " -iso conversin entre DOS y el conjunto de caracteres " "ISO-8859-1\n" " -1252 Usa la pgina de cdigos Windows 1252 (Europa " "Occidental)\n" " -437 Usa la pgina de cdigos DOS 437 (EE. UU.) (por " "defecto)\n" " -850 Usa la pgina de cdigos DOS 850 (Europa Occidental)\n" " -860 Usa la pgina de cdigos DOS 860 (Portugus)\n" " -863 Usa la pgina de cdigos DOS 863 (Francocanadiense)\n" " -865 Usa la pgina de cdigos DOS 865 (Nrdico)\n" " -7 Convierte caracteres de 8 bits al espacio de 7 bits\n" " -c, --convmode modo de conversin\n" " modo_de_conversion ascii, 7bit, iso, mac, por defecto es ascii\n" " -f, --force fuerza la conversin de archivos binarios\n" " -h, --help arroja esta ayuda\n" " -k, --keepdate conserva la fecha en el archivo de salida\n" " -L, --license muestra la licencia del programa\n" " -l, --newline aade salto de lnea adicional\n" " -m, --add-bom aade marca de orden de bytes para UTF-8\n" " -n, --newfile escribe a un nuevo archivo\n" " archivo_de_entrada archivo original en el modo de archivo nuevo\n" " archivo_de_salida archivo de salida en el modo de archivo nuevo\n" " -o, --oldfile escribe al archivo antiguo (por defecto)\n" " archivo ... archivos a convertir en el modo de archivo antiguo\n" " -q, --quiet modo silencioso, suprime todas las advertencias\n" " siempre en modo stdio\n" " -s, --safe ignora archivos binarios (por defecto)\n" #: common.c:225 #, c-format msgid "" " -ul, --assume-utf16le Assume that the input format is UTF-16LE\n" " -ub, --assume-utf16be Assume that the input format is UTF-16BE\n" msgstr "" " -ul, --assume-utf16le Supone que el formato de entrada es UTF-16LE\n" " -ub, --assume-utf16be Supone que el formato de entrada es UTF-16BE\n" #: common.c:230 #, c-format msgid "" " -F, --follow-symlink follow symbolic links and convert the targets\n" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" " -F, --follow-symlink sigue los enlaces simblicos y convierte los " "destinos\n" " -R, --replace-symlink reemplaza los enlaces simblicos con los archivos " "convertidos\n" " (los archivos destino originales no son alterados)\n" " -S, --skip-symlink no altera los enlaces simblicos ni sus destinos (por " "defecto)\n" #: common.c:236 #, c-format msgid " -V, --version display version number\n" msgstr " -V, --version despliega el nmero de versin\n" #: common.c:249 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "Versin DOS de 16 bit (WATCOMC).\n" #: common.c:251 msgid "DOS 16 bit version (TURBOC).\n" msgstr "Versin DOS de 16 bit (TURBOC).\n" #: common.c:253 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "Versin DOS de 32 bit (WATCOMC).\n" #: common.c:255 msgid "DOS 32 bit version (DJGPP).\n" msgstr "Versin DOS de 32 bit (DJGPP).\n" #: common.c:257 msgid "MSYS version.\n" msgstr "Versin para MSYS.\n" #: common.c:259 msgid "Cygwin version.\n" msgstr "Versin para Cygwin.\n" #: common.c:261 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Versin Windows de 64 bit (MinGW-w64).\n" #: common.c:263 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Versin Windows de 32 bit (WATCOMC).\n" #: common.c:265 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Versin Windows de 32 bit (MinGW-w64).\n" #: common.c:267 msgid "Windows 32 bit version (MinGW).\n" msgstr "Versin Windows de 32 bit (MinGW).\n" #: common.c:269 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Versin Windows de 64 bit (MSVC %d).\n" #: common.c:271 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Versin Windows de 32 bit (MSVC %d).\n" #: common.c:273 msgid "OS/2 version (WATCOMC).\n" msgstr "Versin para OS/2 (WATCOMC).\n" #: common.c:275 msgid "OS/2 version (EMX).\n" msgstr "Versin para OS/2 (EMX).\n" #: common.c:278 msgid "With Unicode UTF-16 support.\n" msgstr "Con soporte Unicode UTF-16.\n" #: common.c:280 msgid "Without Unicode UTF-16 support.\n" msgstr "Sin soporte Unicode UTF-16.\n" #: common.c:283 msgid "With native language support.\n" msgstr "Con soporte de idioma materno.\n" dos2unix-6.0.4/po/nl.po0000644000175500010010000003543312245223471014144 0ustar waterlanGeen# dos2unix, DOS/MAC to UNIX text file format converter. # Copyright (C) 2009-2012 # This file is distributed under the same license as the dos2unix package. # Erwin Waterlander , 2009-2012. # msgid "" msgstr "" "Project-Id-Version: dos2unix 5.3.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-26 23:08+0100\n" "PO-Revision-Date: 2009-12-08 21:59+0100\n" "Last-Translator: Erwin Waterlander \n" "Language-Team: Dutch \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: dos2unix.c:76 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: dos2unix.c:164 dos2unix.c:202 unix2dos.c:132 unix2dos.c:185 #, c-format msgid "Binary symbol 0x00%02X found at line %d\n" msgstr "Binair teken 0x00%02X gevonden op regel %d\n" #: dos2unix.c:179 dos2unix.c:218 dos2unix.c:243 dos2unix.c:355 dos2unix.c:391 #: dos2unix.c:413 unix2dos.c:162 unix2dos.c:199 unix2dos.c:220 unix2dos.c:238 #: unix2dos.c:362 unix2dos.c:396 unix2dos.c:414 unix2dos.c:429 #, c-format msgid "can not write to output file: %s\n" msgstr "kan niet schrijven naar uitvoerbestand: %s\n" #: dos2unix.c:259 dos2unix.c:428 unix2dos.c:253 unix2dos.c:443 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "programma fout, ongeldige conversie modus %d\n" #: dos2unix.c:317 unix2dos.c:311 #, c-format msgid "using code page %d.\n" msgstr "codetabel %d wordt gebruikt.\n" #: dos2unix.c:342 dos2unix.c:377 unix2dos.c:334 unix2dos.c:384 #, c-format msgid "Binary symbol 0x%02X found at line %d\n" msgstr "Binair teken 0x%02X gevonden op regel %d\n" #: dos2unix.c:516 unix2dos.c:531 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Niet gelukt om tijdelijk uitvoerbestand te openen: %s\n" #: dos2unix.c:523 unix2dos.c:538 #, c-format msgid "using %s as temporary file\n" msgstr "%s wordt als tijdelijk bestand gebruikt\n" #: dos2unix.c:636 unix2dos.c:651 #, c-format msgid "Failed to write to temporary output file %s: %s\n" msgstr "Niet gelukt om tijdelijk uitvoerbestand %s te schrijven: %s\n" #: dos2unix.c:671 unix2dos.c:686 #, c-format msgid "Failed to change the permissions of temporary output file %s: %s\n" msgstr "" "Niet gelukt om de permissies van tijdelijk uitvoerbestand %s te wijzigen: " "%s\n" #: dos2unix.c:690 unix2dos.c:705 #, c-format msgid "Failed to change the owner and group of temporary output file %s: %s\n" msgstr "" "Niet gelukt om de eigenaar en groep van tijdelijk uitvoerbestand %s te " "wijzigen: %s\n" #: dos2unix.c:743 unix2dos.c:758 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "problemen met het herleiden van symbolische koppeling '%s'\n" #: dos2unix.c:744 dos2unix.c:778 unix2dos.c:759 unix2dos.c:793 #, c-format msgid " output file remains in '%s'\n" msgstr " uitvoerbestand blijft in '%s'\n" #: dos2unix.c:773 unix2dos.c:788 #, c-format msgid "problems renaming '%s' to '%s': %s\n" msgstr "problemen met hernoemen van '%s' naar '%s': %s\n" #: dos2unix.c:776 unix2dos.c:791 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " welke het doel is van symbolische koppeling '%s'\n" #: dos2unix.c:874 unix2dos.c:889 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "fout: Waarde van omgevingsvariabele DOS2UNIX_LOCALEDIR is te lang.\n" #: dos2unix.c:977 dos2unix.c:1014 unix2dos.c:992 unix2dos.c:1029 #, c-format msgid "active code page: %d\n" msgstr "actieve code tabel: %d\n" #: dos2unix.c:1024 unix2dos.c:1039 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "ongeldige %s conversie modus gespecificeerd\n" #: dos2unix.c:1034 unix2dos.c:1049 #, c-format msgid "option '%s' requires an argument\n" msgstr "optie '%s' heeft een argument nodig\n" #: dos2unix.c:1047 dos2unix.c:1061 dos2unix.c:1255 unix2dos.c:1062 #: unix2dos.c:1076 unix2dos.c:1276 #, c-format msgid "target of file %s not specified in new file mode\n" msgstr "doel van bestand %s is niet gespecificeerd in 'nieuw bestand modus'\n" #: dos2unix.c:1091 dos2unix.c:1175 unix2dos.c:1106 unix2dos.c:1193 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "%s wordt overgeslagen, omdat het geen regulier bestand is.\n" #: dos2unix.c:1098 unix2dos.c:1113 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "" "%s wordt overgeslagen, uitvoerbestand %s is een symbolische koppeling.\n" #: dos2unix.c:1105 dos2unix.c:1189 unix2dos.c:1120 unix2dos.c:1207 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "" "Symbolische koppeling %s wordt overgeslagen, omdat het doel geen regulier " "bestand is.\n" #: dos2unix.c:1112 unix2dos.c:1127 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "" "%s wordt overgeslagen, omdat het doel van symbolische koppeling %s geen " "regulier bestand is.\n" #: dos2unix.c:1119 dos2unix.c:1196 unix2dos.c:1134 unix2dos.c:1214 #, c-format msgid "Skipping binary file %s\n" msgstr "Binair bestand %s wordt overgeslagen\n" #: dos2unix.c:1126 dos2unix.c:1203 unix2dos.c:1141 unix2dos.c:1221 #, c-format msgid "code page %d is not supported.\n" msgstr "codetabel %d wordt niet ondersteund.\n" #: dos2unix.c:1133 dos2unix.c:1210 unix2dos.c:1148 unix2dos.c:1228 #, c-format msgid "" "Skipping UTF-16 file %s, the current locale character encoding is not " "UTF-8.\n" msgstr "" "UTF-16 bestand %s wordt overgeslagen, de huidige lokale karakter codering is " "niet UTF-8.\n" #: dos2unix.c:1140 dos2unix.c:1217 unix2dos.c:1155 unix2dos.c:1235 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "" "UTF-16 bestand %s wordt overgeslagen, de grootte van wchar_t is %d bytes.\n" #: dos2unix.c:1147 dos2unix.c:1224 unix2dos.c:1162 unix2dos.c:1242 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n" msgstr "" "UTF-16 bestand %s wordt overgeslagen, een UTF-16 conversie fout is " "opgetreden.\n" #: dos2unix.c:1153 #, c-format msgid "converting file %s to file %s in Unix format ...\n" msgstr "converteren bestand %s naar bestand %s in Unix formaat ...\n" #: dos2unix.c:1160 unix2dos.c:1178 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problemen met conversie van bestand %s naar bestand %s\n" #: dos2unix.c:1182 unix2dos.c:1200 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Symbolische koppeling %s wordt overgeslagen.\n" #: dos2unix.c:1230 #, c-format msgid "converting file %s to Unix format ...\n" msgstr "converteren bestand %s naar Unix formaat ...\n" #: dos2unix.c:1237 unix2dos.c:1258 #, c-format msgid "problems converting file %s\n" msgstr "problemen met conversie van bestand %s\n" #: unix2dos.c:66 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: unix2dos.c:1169 #, c-format msgid "converting file %s to file %s in Mac format ...\n" msgstr "converteren bestand %s naar bestand %s in Mac formaat ...\n" #: unix2dos.c:1171 #, c-format msgid "converting file %s to file %s in DOS format ...\n" msgstr "converteren bestand %s naar bestand %s in DOS formaat ...\n" #: unix2dos.c:1249 #, c-format msgid "converting file %s to Mac format ...\n" msgstr "converteren bestand %s naar Mac formaat ...\n" #: unix2dos.c:1251 #, c-format msgid "converting file %s to DOS format ...\n" msgstr "converteren bestand %s naar DOS formaat ...\n" #: common.c:169 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" #: common.c:195 #, c-format msgid "" "%s %s (%s)\n" "Usage: %s [options] [file ...] [-n infile outfile ...]\n" " -ascii convert only line breaks (default)\n" " -iso conversion between DOS and ISO-8859-1 character set\n" " -1252 Use Windows code page 1252 (Western European)\n" " -437 Use DOS code page 437 (US) (default)\n" " -850 Use DOS code page 850 (Western European)\n" " -860 Use DOS code page 860 (Portuguese)\n" " -863 Use DOS code page 863 (French Canadian)\n" " -865 Use DOS code page 865 (Nordic)\n" " -7 Convert 8 bit characters to 7 bit space\n" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" " -f, --force force conversion of binary files\n" " -h, --help give this help\n" " -k, --keepdate keep output file date\n" " -L, --license display software license\n" " -l, --newline add additional newline\n" " -m, --add-bom add UTF-8 Byte Order Mark\n" " -n, --newfile write to new file\n" " infile original file in new file mode\n" " outfile output file in new file mode\n" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old file mode\n" " -q, --quiet quiet mode, suppress all warnings\n" " always on in stdio mode\n" " -s, --safe skip binary files (default)\n" msgstr "" "%s %s (%s)\n" "Usage: %s [opties] [bestand ...] [-n invoerbestand uitvoerbestand ...]\n" " -ascii converteer alleen regeleindes (standaard)\n" " -iso conversie tussen DOS en ISO-8859-1 lettertekenreeks\n" " -1252 Gebruik Windows codetabel 1252 (West-Europees)\n" " -437 Gebruik DOS codetabel 437 (VS) (standaard)\n" " -850 Gebruik DOS codetabel 850 (West-Europees)\n" " -860 Gebruik DOS codetabel 860 (Portugees)\n" " -863 Gebruik DOS codetabel 863 (Canadees Frans)\n" " -865 Gebruik DOS codetabel 865 (Scandinavisch)\n" " -7 Converteer 8 bit lettertekens naar 7 bit spatie\n" " -c, --convmode conversiemodus\n" " conversiemodus ascii, 7bit, iso, mac, standaard is ascii\n" " -f, --force forceer conversie van binaire bestanden\n" " -h, --help toon deze help tekst\n" " -k, --keepdate behoud datum uitvoerbestand\n" " -L, --license toon software licentie\n" " -l, --newline voeg extra regeleinde toe\n" " -m, --add-bom voeg UTF-8 Byte Order Mark toe\n" " -n, --newfile schrijf naar nieuw bestand\n" " invoerbestand origineel bestand in nieuw-bestand-modus\n" " uitvoerbestand uitvoerbestand in nieuw-bestand-modus\n" " -o, --oldfile overschrijf oud bestand (standaard)\n" " bestand ... te converteren bestanden in oud-bestand-modus\n" " -q, --quiet stille werking, onderdruk alle waarschuwingen\n" " altijd aan in stdio modus\n" " -s, --safe sla binaire bestanden over (standaard)\n" #: common.c:225 #, c-format msgid "" " -ul, --assume-utf16le Assume that the input format is UTF-16LE\n" " -ub, --assume-utf16be Assume that the input format is UTF-16BE\n" msgstr "" " -ul, --assume-utf16le Veronderstel dat het invoerformaat UTF-16LE is\n" " -ub, --assume-utf16be Veronderstel dat het invoerformaat UTF-16BE is\n" #: common.c:230 #, c-format msgid "" " -F, --follow-symlink follow symbolic links and convert the targets\n" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" " -F, --follow-symlink volg symbolische koppelingen en converteer de doelen\n" " -R, --replace-symlink vervang symbolische koppelingen door geconverteerde " "bestanden\n" " (originele doelbestanden blijven ongewijzigd)\n" " -S, --skip-symlink laat symbolische koppelingen en doelen ongewijzigd " "(standaard)\n" #: common.c:236 #, c-format msgid " -V, --version display version number\n" msgstr " -V, --version toon versie nummer\n" #: common.c:249 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16 bit versie (WATCOMC).\n" #: common.c:251 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16 bit versie (TURBOC).\n" #: common.c:253 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32 bit versie (WATCOMC).\n" #: common.c:255 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32 bit versie (DJGPP).\n" #: common.c:257 msgid "MSYS version.\n" msgstr "MSYS versie.\n" #: common.c:259 msgid "Cygwin version.\n" msgstr "Cygwin versie.\n" #: common.c:261 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64 bit versie (MinGW-w64).\n" #: common.c:263 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32 bit versie (WATCOMC).\n" #: common.c:265 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32 bit versie (MinGW-w64).\n" #: common.c:267 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32 bit versie (MinGW).\n" #: common.c:269 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64 bit versie (MSVC %d).\n" #: common.c:271 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32 bit versie (MSVC %d).\n" #: common.c:273 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2 versie (WATCOMC).\n" #: common.c:275 msgid "OS/2 version (EMX).\n" msgstr "OS/2 versie (EMX).\n" #: common.c:278 msgid "With Unicode UTF-16 support.\n" msgstr "Met Unicode UTF-16 ondersteuning.\n" #: common.c:280 msgid "Without Unicode UTF-16 support.\n" msgstr "Zonder Unicode UTF-16 ondersteuning.\n" #: common.c:283 msgid "With native language support.\n" msgstr "Met moedertaal ondersteuning.\n" dos2unix-6.0.4/po/ru.po0000644000175500010010000004545512245223471014166 0ustar waterlanGeen# Russian messages for dos2unix # Copyright (C) 2013 THE dos'S COPYRIGHT HOLDER # This file is distributed under the same license as the dos2unix package. # Andrei Uhlik , 2013. # msgid "" msgstr "" "Project-Id-Version: dos 2unix-6.0.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-26 23:08+0100\n" "PO-Revision-Date: 2013-02-24 19:53+0300\n" "Last-Translator: root \n" "Language-Team: Russian\n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: dos2unix.c:76 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Авторское право (C) 2009-2013 Erwin Waterlander\n" "Авторское право (C) 1998 Christian Wurll (Version 3.1)\n" "Авторское право (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Авторское право (C) 1994-1995 Benjamin Lin\n" "Все права защищены.\n" "\n" #: dos2unix.c:164 dos2unix.c:202 unix2dos.c:132 unix2dos.c:185 #, c-format msgid "Binary symbol 0x00%02X found at line %d\n" msgstr "Бинарный символ 0x00%02X, обнаруженный в строке %d\n" #: dos2unix.c:179 dos2unix.c:218 dos2unix.c:243 dos2unix.c:355 dos2unix.c:391 #: dos2unix.c:413 unix2dos.c:162 unix2dos.c:199 unix2dos.c:220 unix2dos.c:238 #: unix2dos.c:362 unix2dos.c:396 unix2dos.c:414 unix2dos.c:429 #, c-format msgid "can not write to output file: %s\n" msgstr "не удалось записать в выходной файл: %s\n" #: dos2unix.c:259 dos2unix.c:428 unix2dos.c:253 unix2dos.c:443 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "ошибка в программе, неверный режим преобразования %d\n" #: dos2unix.c:317 unix2dos.c:311 #, c-format msgid "using code page %d.\n" msgstr "используется кодировка %d.\n" #: dos2unix.c:342 dos2unix.c:377 unix2dos.c:334 unix2dos.c:384 #, c-format msgid "Binary symbol 0x%02X found at line %d\n" msgstr "Бинарный символ 0x%02X, обнаруженный в строке %d\n" #: dos2unix.c:516 unix2dos.c:531 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Не удалось открыть временный выходной файл: %s\n" #: dos2unix.c:523 unix2dos.c:538 #, c-format msgid "using %s as temporary file\n" msgstr "использование %s в качестве временного файла\n" #: dos2unix.c:636 unix2dos.c:651 #, c-format msgid "Failed to write to temporary output file %s: %s\n" msgstr "Не удалось записать во временный выходной файл %s: %s\n" #: dos2unix.c:671 unix2dos.c:686 #, c-format msgid "Failed to change the permissions of temporary output file %s: %s\n" msgstr "" "Не удалось изменить права доступа ко временному выходному файлу %s: %s\n" #: dos2unix.c:690 unix2dos.c:705 #, c-format msgid "Failed to change the owner and group of temporary output file %s: %s\n" msgstr "" "Не удалось изменить владельца и группу временного выходного файла %s: %s\n" #: dos2unix.c:743 unix2dos.c:758 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "конфликт при разрешении символической ссылки '%s'\n" #: dos2unix.c:744 dos2unix.c:778 unix2dos.c:759 unix2dos.c:793 #, c-format msgid " output file remains in '%s'\n" msgstr " выходной файл остается в '%s'\n" #: dos2unix.c:773 unix2dos.c:788 #, c-format msgid "problems renaming '%s' to '%s': %s\n" msgstr "проблемы при переименовании '%s' в '%s': %s\n" #: dos2unix.c:776 unix2dos.c:791 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " который является целью символической ссылки '%s'\n" #: dos2unix.c:874 unix2dos.c:889 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "" "ошибка: Значение переменной среды DOS2UNIX_LOCALEDIR слишком длинное.\n" #: dos2unix.c:977 dos2unix.c:1014 unix2dos.c:992 unix2dos.c:1029 #, c-format msgid "active code page: %d\n" msgstr "активная кодовая страница: %d\n" #: dos2unix.c:1024 unix2dos.c:1039 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "задан неправильный %s режим преобразования\n" #: dos2unix.c:1034 unix2dos.c:1049 #, c-format msgid "option '%s' requires an argument\n" msgstr "для опции '%s' требуется аргумент\n" #: dos2unix.c:1047 dos2unix.c:1061 dos2unix.c:1255 unix2dos.c:1062 #: unix2dos.c:1076 unix2dos.c:1276 #, c-format msgid "target of file %s not specified in new file mode\n" msgstr "цель файла %s не задана в новом режиме файла\n" #: dos2unix.c:1091 dos2unix.c:1175 unix2dos.c:1106 unix2dos.c:1193 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Пропуск %s, не является подходящим файлом.\n" #: dos2unix.c:1098 unix2dos.c:1113 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Пропуск %s, выходной файл %s является символической ссылкой.\n" #: dos2unix.c:1105 dos2unix.c:1189 unix2dos.c:1120 unix2dos.c:1207 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Пропуск символической ссылки %s, цель не является подходящим файлом.\n" #: dos2unix.c:1112 unix2dos.c:1127 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "" "Пропуск %s, цель символической ссылки %s не является подходящим файлом.\n" #: dos2unix.c:1119 dos2unix.c:1196 unix2dos.c:1134 unix2dos.c:1214 #, c-format msgid "Skipping binary file %s\n" msgstr "Пропуск бинарного файла %s\n" #: dos2unix.c:1126 dos2unix.c:1203 unix2dos.c:1141 unix2dos.c:1221 #, c-format msgid "code page %d is not supported.\n" msgstr "кодовая страница %d не поддерживается.\n" #: dos2unix.c:1133 dos2unix.c:1210 unix2dos.c:1148 unix2dos.c:1228 #, c-format msgid "" "Skipping UTF-16 file %s, the current locale character encoding is not " "UTF-8.\n" msgstr "Пропуск UTF-16 файла %s, текущая символьная кодировка не UTF-8.\n" #: dos2unix.c:1140 dos2unix.c:1217 unix2dos.c:1155 unix2dos.c:1235 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Пропуск UTF-16 файла %s, размер wchar_t составляет %d байт.\n" #: dos2unix.c:1147 dos2unix.c:1224 unix2dos.c:1162 unix2dos.c:1242 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n" msgstr "Пропуск UTF-16 файла %s, возникла ошибка преобразования UTF-16.\n" #: dos2unix.c:1153 #, c-format msgid "converting file %s to file %s in Unix format ...\n" msgstr "преобразование файла %s в файл %s в формат Unix ...\n" #: dos2unix.c:1160 unix2dos.c:1178 #, c-format msgid "problems converting file %s to file %s\n" msgstr "проблемы при преобразовании файла %s в файл %s\n" #: dos2unix.c:1182 unix2dos.c:1200 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Пропуск символической ссылки %s.\n" #: dos2unix.c:1230 #, c-format msgid "converting file %s to Unix format ...\n" msgstr "преобразование файла %s в формат Unix ...\n" #: dos2unix.c:1237 unix2dos.c:1258 #, c-format msgid "problems converting file %s\n" msgstr "проблемы при преобразовании файла %s\n" #: unix2dos.c:66 msgid "" "Copyright (C) 2009-2013 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Авторское право (C) 2009-2013 Erwin Waterlander\n" "Авторское право (C) 1994-1995 Benjamin Lin\n" "Все права защищены.\n" "\n" #: unix2dos.c:1169 #, c-format msgid "converting file %s to file %s in Mac format ...\n" msgstr "преобразование файла %s в файл %s в формат Mac ...\n" #: unix2dos.c:1171 #, c-format msgid "converting file %s to file %s in DOS format ...\n" msgstr "преобразование файла %s в файл %s в формат DOS ...\n" #: unix2dos.c:1249 #, c-format msgid "converting file %s to Mac format ...\n" msgstr "преобразование файла %s в формат Mac ...\n" #: unix2dos.c:1251 #, c-format msgid "converting file %s to DOS format ...\n" msgstr "преобразование файла %s в формат DOS ...\n" #: common.c:169 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" #: common.c:195 #, c-format msgid "" "%s %s (%s)\n" "Usage: %s [options] [file ...] [-n infile outfile ...]\n" " -ascii convert only line breaks (default)\n" " -iso conversion between DOS and ISO-8859-1 character set\n" " -1252 Use Windows code page 1252 (Western European)\n" " -437 Use DOS code page 437 (US) (default)\n" " -850 Use DOS code page 850 (Western European)\n" " -860 Use DOS code page 860 (Portuguese)\n" " -863 Use DOS code page 863 (French Canadian)\n" " -865 Use DOS code page 865 (Nordic)\n" " -7 Convert 8 bit characters to 7 bit space\n" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" " -f, --force force conversion of binary files\n" " -h, --help give this help\n" " -k, --keepdate keep output file date\n" " -L, --license display software license\n" " -l, --newline add additional newline\n" " -m, --add-bom add UTF-8 Byte Order Mark\n" " -n, --newfile write to new file\n" " infile original file in new file mode\n" " outfile output file in new file mode\n" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old file mode\n" " -q, --quiet quiet mode, suppress all warnings\n" " always on in stdio mode\n" " -s, --safe skip binary files (default)\n" msgstr "" "%s %s (%s)\n" "Использование: %s [опции] [файл ...] [-n входной_файл выходной_файл ...]\n" " -ascii преобразовать только конец строки (по умолчанию)\n" " -iso преобразовать DOS в ISO-8859-1\n" " -1252 Использовать кодировку Windows 1252 (Западно-" "Европейский)\n" " -437 Использовать кодировку DOS 437 (US) (по умолчанию)\n" " -850 Использовать кодировку DOS 850 (Западно-Европейский)\n" " -860 Использовать кодировку DOS 860 (Португальский)\n" " -863 Использовать кодировку DOS 863 (Франко-Канадский)\n" " -865 Использовать кодировку DOS 865 (Скандинавский)\n" " -7 Преобразовать 8-битные символы в 7-битные с пробелом\n" " -c, --convmode режим преобразования\n" " convmode ascii, 7bit, iso, mac, по умолчанию в ascii\n" " -f, --force управление преобразованием бинарных файлов\n" " -h, --help вызов справки\n" " -k, --keepdate сохранить дату выходного файла\n" " -L, --license отобразить лицензию программного обеспечения\n" " -l, --newline добавить дополнительный разделитель строк\n" " -m, --add-bom добавить UTF-8 метку порядка байтов (BOM)\n" " -n, --newfile записать в новый файл\n" " infile исходный файл с новым режимным кодом файла\n" " outfile выходной файл с новым режимным кодом файла\n" " -o, --oldfile записать в старый файл (по умолчанию)\n" " file ... файлы для преобразования в старый режимный код файла\n" " -q, --quiet тихий режим, скрыть все предупреждения\n" " всегда включен в режиме stdio\n" " -s, --safe пропустить бинарные файлы (по умолчанию)\n" #: common.c:225 #, c-format msgid "" " -ul, --assume-utf16le Assume that the input format is UTF-16LE\n" " -ub, --assume-utf16be Assume that the input format is UTF-16BE\n" msgstr "" " -ul, --assume-utf16le Предположить что входной формат UTF-16LE\n" " -ub, --assume-utf16be Предположить что входной формат UTF-16BE\n" #: common.c:230 #, c-format msgid "" " -F, --follow-symlink follow symbolic links and convert the targets\n" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" " -F, --follow-symlink следовать символическим ссылкам и преобразовать цели\n" " -R, --replace-symlink заменить символические ссылки преобразованными " "файлами\n" " (оригинальные целевые файлы останутся без изменений)\n" " -S, --skip-symlink оставить символические ссылки и цели без изменений " "(по умолчанию)\n" #: common.c:236 #, c-format msgid " -V, --version display version number\n" msgstr " -V, --version отобразить номер версии\n" #: common.c:249 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16 bit версия (WATCOMC).\n" #: common.c:251 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16 bit версия (TURBOC).\n" #: common.c:253 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32 bit версия (WATCOMC).\n" #: common.c:255 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32 bit версия (DJGPP).\n" #: common.c:257 msgid "MSYS version.\n" msgstr "MSYS версия.\n" #: common.c:259 msgid "Cygwin version.\n" msgstr "Cygwin версия.\n" #: common.c:261 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64 bit версия (MinGW-w64).\n" #: common.c:263 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32 bit версия (WATCOMC).\n" #: common.c:265 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32 bit версия (MinGW-w64).\n" #: common.c:267 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32 bit версия (MinGW).\n" #: common.c:269 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64 bit версия (MSVC %d).\n" #: common.c:271 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32 bit версия (MSVC %d).\n" #: common.c:273 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2 версия (WATCOMC).\n" #: common.c:275 msgid "OS/2 version (EMX).\n" msgstr "OS/2 версия (EMX).\n" #: common.c:278 msgid "With Unicode UTF-16 support.\n" msgstr "С поддержкой Unicode UTF-16.\n" #: common.c:280 msgid "Without Unicode UTF-16 support.\n" msgstr "Без поддержки Unicode UTF-16.\n" #: common.c:283 msgid "With native language support.\n" msgstr "С поддержкой родного языка.\n" dos2unix-6.0.4/querycp.c0000644000175500010010000001401412066312422014375 0ustar waterlanGeen/* querycp.c is in the public domain */ #if (defined(__WATCOMC__) && defined(__NT__)) # define _WIN32 1 #endif #ifdef __DJGPP__ #include #include #include /* ---------------------------------------------------------------------- Tuesday, May 5, 2009 1:40pm rugxulo _AT_ gmail _DOT_ com This file is (obviously?) not copyrighted, "nenies proprajxo" !! Tested successfully on DR-DOS 7.03, FreeDOS 1.0++, and MS-DOS 6.22. (Doesn't work on XP or Vista, though.) ---------------------------------------------------------------------- unsigned short query_con_codepage(void); gets currently selected display CON codepage int 21h, 6601h ("chcp") needs NLSFUNC.EXE + COUNTRY.SYS, but many obscure codepages (e.g. FD's cp853 from EGA.CPX (CPIX.ZIP) or Kosta Kostis' cp913 from ISOLATIN.CPI (ISOCP101.ZIP) have no relevant data inside COUNTRY.SYS. int 21h, 440Ch 6Ah only works in MS-DOS and DR-DOS (not FreeDOS) because FreeDOS DISPLAY is an .EXE TSR, not a device driver, and hence doesn't fully support IOCTL, so they use the undocumented int 2Fh, 0AD02h (which doesn't work in DR-DOS!). But DR-DOS' DISPLAY doesn't respond to the typical install check i.d. anyways. FreeDOS currently only supports COUNTRY.SYS in their "unstable" kernel 2037, but at least their KEYB, "gxoje", supports cp853 too (thanks, Henrique!). P.S. For MS or DR: ren ega.cpx *.com ; upx -d ega.com ; ren ega.com *.cpi ADDENDUM (2011): Latest "stable" FreeDOS kernel is 2040, it now includes COUNTRY.SYS support by default, but NLSFUNC (CHCP) 'system code page' support is partially unimplemented (lacking some int 2Fh calls, yet Eduardo Casino didn't seem too worried, so I dunno, nag him if necessary, heh). ---------------------------------------------------------------------- */ unsigned short query_con_codepage(void) { __dpmi_regs regs; unsigned short param_block[2] = { 0, 437 }; regs.d.eax = 0x440C; /* GENERIC IO FOR HANDLES */ regs.d.ebx = 1; /* STDOUT */ regs.d.ecx = 0x036A; /* 3 = CON, 0x6A = QUERY SELECTED CP */ regs.x.ds = __tb >> 4; /* using transfer buffer for low mem. */ regs.x.dx = __tb & 0x0F; /* (suggested by DJGPP FAQ, hi Eli!) */ regs.x.flags |= 1; /* preset carry for potential failure */ __dpmi_int (0x21, ®s); if (!(regs.x.flags & 1)) /* if succeed (carry flag not set) */ dosmemget( __tb, 4, param_block); else { /* (undocumented method) */ regs.x.ax = 0xAD02; /* 440C -> MS-DOS or DR-DOS only */ regs.x.bx = 0xFFFE; /* AD02 -> MS-DOS or FreeDOS only */ regs.x.flags |= 1; __dpmi_int(0x2F, ®s); if ((!(regs.x.flags & 1)) && (regs.x.bx < 0xFFFE)) param_block[1] = regs.x.bx; } return param_block[1]; } #elif defined(__WATCOMC__) && defined(__I86__) /* Watcom C, 16 bit Intel */ /* rugxulo _AT_ gmail _DOT_ com */ #include #include #include unsigned short query_con_codepage(void) { union REGS regs; unsigned short param_block[2] = { 0, 437 }; regs.x.ax = 0x440C; /* GENERIC IO FOR HANDLES */ regs.x.bx = 1; /* STDOUT */ regs.x.cx = 0x036A; /* 3 = CON, 0x6A = QUERY SELECTED CP */ regs.x.dx = (unsigned short)param_block; regs.x.cflag |= 1; /* preset carry for potential failure */ int86(0x21, ®s, ®s); if (regs.x.cflag) /* if not succeed (carry flag set) */ { regs.x.ax = 0xAD02; /* 440C -> MS-DOS or DR-DOS only */ regs.x.bx = 0xFFFE; /* AD02 -> MS-DOS or FreeDOS only */ regs.x.cflag |= 1; int86(0x2F, ®s, ®s); } if ((!(regs.x.cflag)) && (regs.x.bx < 0xFFFE)) param_block[1] = regs.x.bx; return param_block[1]; } #elif defined(__WATCOMC__) && defined(__DOS__) /* Watcom C, 32 bit DOS */ /* rugxulo _AT_ gmail _DOT_ com */ #include #include #include unsigned short query_con_codepage(void) { union REGS regs; unsigned short param_block[2] = { 0, 437 }; regs.x.eax = 0x440C; /* GENERIC IO FOR HANDLES */ regs.x.ebx = 1; /* STDOUT */ regs.x.ecx = 0x036A; /* 3 = CON, 0x6A = QUERY SELECTED CP */ regs.x.edx = (unsigned short)param_block; regs.x.cflag |= 1; /* preset carry for potential failure */ int386(0x21, ®s, ®s); if (regs.x.cflag) /* if not succeed (carry flag set) */ { regs.x.eax = 0xAD02; /* 440C -> MS-DOS or DR-DOS only */ regs.x.ebx = 0xFFFE; /* AD02 -> MS-DOS or FreeDOS only */ regs.x.cflag |= 1; int386(0x2F, ®s, ®s); } if ((!(regs.x.cflag)) && (regs.x.ebx < 0xFFFE)) param_block[1] = regs.x.ebx; return param_block[1]; } #elif defined (_WIN32) && !defined(__CYGWIN__) /* Windows, not Cygwin */ /* Erwin Waterlander */ #include unsigned short query_con_codepage(void) { /* Dos2unix is modelled after dos2unix under SunOS/Solaris. * The original dos2unix ISO mode on SunOS supported code * pages CP437, CP850, CP860, CP863, and CP865, which * are DOS code pages. Therefore we request here the DOS * code page of the Console. The DOS code page is used * by DOS programs, for instance text editor 'edit'. */ /* Get the console's DOS code page */ return((unsigned short)GetConsoleOutputCP()); /* Get the system's ANSI code page */ /* return((unsigned short)GetACP()); */ } #elif defined (__OS2__) /* OS/2 Warp */ #define INCL_DOS #include unsigned short query_con_codepage(void) { ULONG cp[3]; ULONG cplen; DosQueryCp(sizeof(cp), cp, &cplen); return((unsigned short)cp[0]); } #else /* Unix, other */ unsigned short query_con_codepage(void) { return(0); } #endif #ifdef TEST int main() { printf("\nCP%u\n",query_con_codepage() ); /* should be same result as */ return 0; /* "mode con cp /status" */ } #endif dos2unix-6.0.4/querycp.h0000644000175500010010000000012212066312422014375 0ustar waterlanGeen/* querycp.h is in the public domain */ unsigned short query_con_codepage(void); dos2unix-6.0.4/README.txt0000644000175500010010000001130012260365416014241 0ustar waterlanGeen dos2unix - DOS/Mac to Unix and vice versa text file format converter. FILE LIST README.txt : This file. INSTALL.txt : How to build and install. COPYING.txt : distribution license. NEWS.txt : Basic change log for users. ChangeLog.txt : Detailed change log for programmers. TODO.txt : Things to do. BUGS.txt : Known bugs and instructions on reporting new ones. dos2unix.txt : Dos2unix manual, text format. dos2unix.ps : Dos2unix manual, PostScript format. dos2unix.pdf : Dos2unix manual, PDF format. dos2unix.htm : Dos2unix manual, HTML format. HISTORY This is an update of Benjamin Lin's implementations of dos2unix and unix2dos. Benjamin Lin's implementations of dos2unix and unix2dos are part of several Linux distributions such as RedHat, Fedora, Suse and others. This update includes all RedHat patches and fixes several other problems. Internationalization has been added and ports to DOS, Windows, Cygwin and OS/2 Warp have been made. These implementations of dos2unix and unix2dos have been modelled after dos2unix/unix2dos under SunOS/Solaris. They have similar conversion modes, namely ascii, 7bit and iso. The first versions were made by John Birchfield in 1989, and in 1995 rewritten from scratch by Benjamin Lin. Mac to Unix conversion was added by Bernd Johannes Wuebben in 1998, Unix to Mac conversion by Erwin Waterlander in 2010. Features * Native language support: Dutch, English, Esperanto, German, Russian, Spanish. * Automatically skips binary and non-regular files * In-place, paired, or stdio mode conversion. * Keep original file dates option. * 7-bit and iso conversion modes like SunOS dos2unix. * Conversion of Windows UTF-16 files to Unix UTF-8. * Secure. AUTHORS Erwin Waterlander version 3.2-6.0.4 2009-2013 Christian Wurll version 3.1 1998 Bernd Johannes Wuebben version 3.0 1998 Benjamin Lin version 1.1-2.3 1994-1995 John Birchfield version 1.0 1989 TRANSLATORS Dutch Erwin Waterlander Esperanto Rugxulo German Philipp Thomas German Lars Wendler Version 6.0.4. Russian Андрей Углик (Andrei Uhlik) Spanish Julio A. Freyre-Gonzalez ACKNOWLEDGEMENTS Rugxulo query_con_codepage(), code page detection in DOS. Rugxulo DJGPP stubs for mac2unix and unix2mac. Jari Aalto Improvements man page. Jari Aalto Improvements Makefile. Ben Pfaff Treat form feeds as valid text. Marc Gianzero Darwin OS port. Elbert Pol OS/2 port. Tim Waugh Various patches. Mike Harris Man page update. Bernard RosenKraenzer segfault patch. Tim Powers mkstemp patch. Miloslav Trmac safeconv patch. Charles Wilson Follow symbolic links. Charles Wilson Makefile and code cleanup for Cygwin. Christopher Williams Maintain file ownership in old file mode. Steven H. Levine Support wildcard expansion on OS/2. Steve Hay Support wildcard expansion on win64. Michael Schindler Fixed compiler warning. Somsak Pattanaprateep Print line number when binary symbol is found. Justin Lecher Makefile improvement. F.J. Brandelik Reported problems when win32 version processes huge files on a network drive. FINDUTILS Windows users who are looking for the Unix 'find' and 'xargs' commands can find them in the findutils package for Windows at the ezwinports project page at: http://sourceforge.net/projects/ezwinports/files/ A DOS version of the findutils package can be obtained from the DJGPP project (http://www.delorie.com/djgpp/) at ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/ CONTACT INFORMATION Project page : http://waterlan.home.xs4all.nl/dos2unix.html SourceForge project page : http://sourceforge.net/projects/dos2unix/ Freecode project page : http://freecode.com/projects/dos2unix/ Erwin Waterlander waterlan@xs4all.nl http://waterlan.home.xs4all.nl/ dos2unix-6.0.4/test/0000755000175500010010000000000012260366761013533 5ustar waterlanGeendos2unix-6.0.4/test/utf16_be.txt0000755000175500010010000000360612062163344015707 0ustar waterlanGeen(\(X! YeW0R)QqTV(\(X!]v^ 2007^tNS~15N f/~~N_~0h #endif #endif void PrintLicense(void) { fprintf(stderr, "%s", _("\ Copyright (C) 2009-2013 Erwin Waterlander\n\ Copyright (C) 1994-1995 Benjamin Lin\n\ All rights reserved.\n\n")); PrintBSDLicense(); } #ifdef D2U_UNICODE void AddDOSNewLineW(FILE* ipOutF, CFlag *ipFlag, wint_t CurChar, wint_t PrevChar) { if (ipFlag->NewLine) { /* add additional CR-LF? */ /* Don't add line ending if it is a DOS line ending. Only in case of Unix line ending. */ if ((CurChar == 0x0a) && (PrevChar != 0x0d)) { d2u_putwc(0x0d, ipOutF, ipFlag); d2u_putwc(0x0a, ipOutF, ipFlag); } } } #endif void AddDOSNewLine(FILE* ipOutF, CFlag *ipFlag, int CurChar, int PrevChar) { if (ipFlag->NewLine) { /* add additional CR-LF? */ /* Don't add line ending if it is a DOS line ending. Only in case of Unix line ending. */ if ((CurChar == '\x0a') && (PrevChar != '\x0d')) { fputc('\x0d', ipOutF); fputc('\x0a', ipOutF); } } } /* converts stream ipInF to DOS format text and write to stream ipOutF * RetVal: 0 if success * -1 otherwise */ #ifdef D2U_UNICODE int ConvertUnixToDosW(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, char *progname) { int RetVal = 0; wint_t TempChar; wint_t PreviousChar = 0; int line_nr = 1; char *errstr; ipFlag->status = 0; /* LF -> CR-LF */ /* CR-LF -> CR-LF, in case the input file is a DOS text file */ /* \x0a = Newline/Line Feed (LF) */ /* \x0d = Carriage Return (CR) */ switch (ipFlag->FromToMode) { case FROMTO_UNIX2DOS: /* unix2dos */ while ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { /* get character */ if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != 0x0a) && /* Not an LF */ (TempChar != 0x0d) && /* Not a CR */ (TempChar != 0x09) && /* Not a TAB */ (TempChar != 0x0c)) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Binary symbol 0x00%02X found at line %d\n"),TempChar, line_nr); } break; } if (TempChar == 0x0a) { d2u_putwc(0x0d, ipOutF, ipFlag); /* got LF, put extra CR */ } else { if (TempChar == 0x0d) /* got CR */ { if ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) == WEOF) /* get next char (possibly LF) */ TempChar = 0x0d; /* Read error, or end of file. */ else { d2u_putwc(0x0d, ipOutF, ipFlag); /* put CR */ PreviousChar = 0x0d; } } } if (TempChar == 0x0a) /* Count all DOS and Unix line breaks */ ++line_nr; if (d2u_putwc(TempChar, ipOutF, ipFlag) == WEOF) { RetVal = -1; if (!ipFlag->Quiet) { if (!(ipFlag->status & UNICODE_CONVERSION_ERROR)) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } } break; } else { AddDOSNewLineW( ipOutF, ipFlag, TempChar, PreviousChar); } PreviousChar = TempChar; } break; case FROMTO_UNIX2MAC: /* unix2mac */ while ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != 0x0a) && /* Not an LF */ (TempChar != 0x0d) && /* Not a CR */ (TempChar != 0x09) && /* Not a TAB */ (TempChar != 0x0c)) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Binary symbol 0x00%02X found at line %d\n"),TempChar, line_nr); } break; } if ((TempChar != 0x0a)) /* Not an LF */ { if(d2u_putwc(TempChar, ipOutF, ipFlag) == WEOF){ RetVal = -1; if (!ipFlag->Quiet) { if (!(ipFlag->status & UNICODE_CONVERSION_ERROR)) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } } break; } PreviousChar = TempChar; } else{ /* TempChar is an LF */ ++line_nr; /* Don't touch this delimiter if it's a CR,LF pair. */ if ( PreviousChar == 0x0d ) { if (d2u_putwc(0x0a, ipOutF, ipFlag) == WEOF) /* CR,LF pair. Put LF */ { RetVal = -1; if (!ipFlag->Quiet) { if (!(ipFlag->status & UNICODE_CONVERSION_ERROR)) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } } break; } PreviousChar = TempChar; continue; } PreviousChar = TempChar; if (d2u_putwc(0x0d, ipOutF, ipFlag) == WEOF) /* Unix line end (LF). Put CR */ { RetVal = -1; if (!ipFlag->Quiet) { if (!(ipFlag->status & UNICODE_CONVERSION_ERROR)) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } } break; } if (ipFlag->NewLine) { /* add additional CR? */ d2u_putwc(0x0d, ipOutF, ipFlag); } } } break; default: /* unknown FromToMode */ ; #if DEBUG fprintf(stderr, "%s: ", progname); fprintf(stderr, _("program error, invalid conversion mode %d\n"),ipFlag->FromToMode); exit(1); #endif } return RetVal; } #endif /* converts stream ipInF to DOS format text and write to stream ipOutF * RetVal: 0 if success * -1 otherwise */ int ConvertUnixToDos(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, char *progname) { int RetVal = 0; int TempChar; int PreviousChar = 0; int *ConvTable; int line_nr = 1; char *errstr; ipFlag->status = 0; switch (ipFlag->ConvMode) { case CONVMODE_ASCII: /* ascii */ case CONVMODE_UTF16LE: /* Assume UTF-16LE */ case CONVMODE_UTF16BE: /* Assume UTF-16BE */ ConvTable = U2DAsciiTable; break; case CONVMODE_7BIT: /* 7bit */ ConvTable = U2D7BitTable; break; case CONVMODE_437: /* iso */ ConvTable = U2DIso437Table; break; case CONVMODE_850: /* iso */ ConvTable = U2DIso850Table; break; case CONVMODE_860: /* iso */ ConvTable = U2DIso860Table; break; case CONVMODE_863: /* iso */ ConvTable = U2DIso863Table; break; case CONVMODE_865: /* iso */ ConvTable = U2DIso865Table; break; case CONVMODE_1252: /* iso */ ConvTable = U2DIso1252Table; break; default: /* unknown convmode */ ipFlag->status |= WRONG_CODEPAGE ; return(-1); } if ((ipFlag->ConvMode > 1) && (!ipFlag->Quiet)) /* not ascii or 7bit */ { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("using code page %d.\n"), ipFlag->ConvMode); } /* LF -> CR-LF */ /* CR-LF -> CR-LF, in case the input file is a DOS text file */ /* \x0a = Newline/Line Feed (LF) */ /* \x0d = Carriage Return (CR) */ switch (ipFlag->FromToMode) { case FROMTO_UNIX2DOS: /* unix2dos */ while ((TempChar = fgetc(ipInF)) != EOF) { /* get character */ if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != '\x0a') && /* Not an LF */ (TempChar != '\x0d') && /* Not a CR */ (TempChar != '\x09') && /* Not a TAB */ (TempChar != '\x0c')) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Binary symbol 0x%02X found at line %d\n"),TempChar, line_nr); } break; } if (TempChar == '\x0a') { fputc('\x0d', ipOutF); /* got LF, put extra CR */ } else { if (TempChar == '\x0d') /* got CR */ { if ((TempChar = fgetc(ipInF)) == EOF) /* get next char (possibly LF) */ TempChar = '\x0d'; /* Read error, or end of file. */ else { fputc('\x0d', ipOutF); /* put CR */ PreviousChar = '\x0d'; } } } if (TempChar == '\x0a') /* Count all DOS and Unix line breaks */ ++line_nr; if (fputc(ConvTable[TempChar], ipOutF) == EOF) /* put LF or other char */ { RetVal = -1; if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } break; } else { AddDOSNewLine( ipOutF, ipFlag, TempChar, PreviousChar); } PreviousChar = TempChar; } break; case FROMTO_UNIX2MAC: /* unix2mac */ while ((TempChar = fgetc(ipInF)) != EOF) { if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != '\x0a') && /* Not an LF */ (TempChar != '\x0d') && /* Not a CR */ (TempChar != '\x09') && /* Not a TAB */ (TempChar != '\x0c')) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Binary symbol 0x%02X found at line %d\n"),TempChar, line_nr); } break; } if ((TempChar != '\x0a')) /* Not an LF */ { if(fputc(ConvTable[TempChar], ipOutF) == EOF){ RetVal = -1; if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } break; } PreviousChar = TempChar; } else{ /* TempChar is an LF */ ++line_nr; /* Don't touch this delimiter if it's a CR,LF pair. */ if ( PreviousChar == '\x0d' ) { if (fputc('\x0a', ipOutF) == EOF) /* CR,LF pair. Put LF */ { RetVal = -1; if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } break; } PreviousChar = TempChar; continue; } PreviousChar = TempChar; if (fputc('\x0d', ipOutF) == EOF) /* Unix line end (LF). Put CR */ { RetVal = -1; if (!ipFlag->Quiet) { errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("can not write to output file: %s\n"), errstr); } break; } if (ipFlag->NewLine) { /* add additional CR? */ fputc('\x0d', ipOutF); } } } break; default: /* unknown FromToMode */ ; #if DEBUG fprintf(stderr, "%s: ", progname); fprintf(stderr, _("program error, invalid conversion mode %d\n"),ipFlag->FromToMode); exit(1); #endif } return RetVal; } /* convert file ipInFN to DOS format text and write to file ipOutFN * RetVal: 0 if success * -1 otherwise */ int ConvertUnixToDosNewFile(char *ipInFN, char *ipOutFN, CFlag *ipFlag, char *progname) { int RetVal = 0; FILE *InF = NULL; FILE *TempF = NULL; char *TempPath; char *errstr; struct stat StatBuf; struct utimbuf UTimeBuf; #ifndef NO_CHMOD mode_t mask; #endif #ifdef NO_MKSTEMP FILE* fd; #else int fd; #endif char *TargetFN = NULL; int ResolveSymlinkResult = 0; ipFlag->status = 0 ; /* Test if output file is a symbolic link */ if (symbolic_link(ipOutFN) && !ipFlag->Follow) { ipFlag->status |= OUTPUTFILE_SYMLINK ; /* Not a failure, skipping input file according spec. (keep symbolic link unchanged) */ return -1; } /* Test if input file is a regular file or symbolic link */ if (regfile(ipInFN, 1, ipFlag, progname)) { ipFlag->status |= NO_REGFILE ; /* Not a failure, skipping non-regular input file according spec. */ return -1; } /* Test if input file target is a regular file */ if (symbolic_link(ipInFN) && regfile_target(ipInFN, ipFlag,progname)) { ipFlag->status |= INPUT_TARGET_NO_REGFILE ; /* Not a failure, skipping non-regular input file according spec. */ return -1; } /* Test if output file target is a regular file */ if (symbolic_link(ipOutFN) && (ipFlag->Follow == SYMLINK_FOLLOW) && regfile_target(ipOutFN, ipFlag,progname)) { ipFlag->status |= OUTPUT_TARGET_NO_REGFILE ; /* Failure, input is regular, cannot produce output. */ if (!ipFlag->error) ipFlag->error = 1; return -1; } /* retrieve ipInFN file date stamp */ if (stat(ipInFN, &StatBuf)) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, ipInFN, errstr); } RetVal = -1; } #ifdef NO_MKSTEMP if((fd = MakeTempFileFrom(ipOutFN, &TempPath))==NULL) { #else if((fd = MakeTempFileFrom (ipOutFN, &TempPath)) < 0) { #endif if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Failed to open temporary output file: %s\n"), errstr); } RetVal = -1; } #if DEBUG fprintf(stderr, "%s: ", progname); fprintf(stderr, _("using %s as temporary file\n"), TempPath); #endif /* can open in file? */ if (!RetVal) { InF=OpenInFile(ipInFN); if (InF == NULL) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, ipInFN, errstr); RetVal = -1; } } /* can open output file? */ if ((!RetVal) && (InF)) { #ifdef NO_MKSTEMP if ((TempF=fd) == NULL) { #else if ((TempF=OpenOutFile(fd)) == NULL) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s\n", progname, errstr); #endif fclose (InF); InF = NULL; RetVal = -1; } } InF = read_bom(InF, &ipFlag->bomtype); #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16LE)) ipFlag->bomtype = FILE_UTF16LE; if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16BE)) ipFlag->bomtype = FILE_UTF16BE; #endif #ifdef D2U_UNICODE #if !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__) /* Unix, Cygwin */ if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { if (strcmp(nl_langinfo(CODESET), "UTF-8") != 0) { /* Don't convert UTF-16 files when the locale encoding is not UTF-8 * to prevent loss of characters. */ ipFlag->status |= LOCALE_NOT_UTF8 ; if (!ipFlag->error) ipFlag->error = 1; RetVal = -1; } } #endif #if !defined(_WIN32) && !defined(__CYGWIN__) /* Not Windows or Cygwin */ if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { if (sizeof(wchar_t) < 4) { /* A decoded UTF-16 surrogate pair must fit in a wchar_t */ ipFlag->status |= WCHAR_T_TOO_SMALL ; if (!ipFlag->error) ipFlag->error = 1; RetVal = -1; } } #endif #endif if ((ipFlag->add_bom) || (ipFlag->bomtype > 0)) fprintf(TempF, "%s", "\xEF\xBB\xBF"); /* UTF-8 BOM */ /* Turn off ISO and 7-bit conversion for Unicode text files */ /* When we assume UTF16, don't change the conversion mode. We need to remember it. */ if ((ipFlag->bomtype > 0) && (ipFlag->ConvMode != CONVMODE_UTF16LE) && (ipFlag->ConvMode != CONVMODE_UTF16BE)) ipFlag->ConvMode = CONVMODE_ASCII; /* conversion sucessful? */ #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { if ((!RetVal) && (ConvertUnixToDosW(InF, TempF, ipFlag, progname))) RetVal = -1; if (ipFlag->status & UNICODE_CONVERSION_ERROR) { if (!ipFlag->error) ipFlag->error = 1; RetVal = -1; } } else { if ((!RetVal) && (ConvertUnixToDos(InF, TempF, ipFlag, progname))) RetVal = -1; } #else if ((!RetVal) && (ConvertUnixToDos(InF, TempF, ipFlag, progname))) RetVal = -1; #endif /* can close in file? */ if ((InF) && (fclose(InF) == EOF)) RetVal = -1; /* can close output file? */ if (TempF) { if (fclose(TempF) == EOF) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Failed to write to temporary output file %s: %s\n"), TempPath, errstr); } RetVal = -1; } } #ifdef NO_MKSTEMP if(fd!=NULL) fclose(fd); #else if(fd>=0) close(fd); #endif #ifndef NO_CHMOD if (!RetVal) { if (ipFlag->NewFile == 0) /* old file mode */ { RetVal = chmod (TempPath, StatBuf.st_mode); /* set original permissions */ } else { mask = umask(0); /* get process's umask */ umask(mask); /* set umask back to original */ RetVal = chmod(TempPath, StatBuf.st_mode & ~mask); /* set original permissions, minus umask */ } if (RetVal) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Failed to change the permissions of temporary output file %s: %s\n"), TempPath, errstr); } } } #endif #ifndef NO_CHOWN if (!RetVal && (ipFlag->NewFile == 0)) /* old file mode */ { /* Change owner and group of the the tempory output file to the original file's uid and gid. */ /* Required when a different user (e.g. root) has write permission on the original file. */ /* Make sure that the original owner can still access the file. */ if (chown(TempPath, StatBuf.st_uid, StatBuf.st_gid)) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("Failed to change the owner and group of temporary output file %s: %s\n"), TempPath, errstr); } RetVal = -1; } } #endif if ((!RetVal) && (ipFlag->KeepDate)) { UTimeBuf.actime = StatBuf.st_atime; UTimeBuf.modtime = StatBuf.st_mtime; /* can change output file time to in file time? */ if (utime(TempPath, &UTimeBuf) == -1) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, TempPath, errstr); } RetVal = -1; } } /* any error? cleanup the temp file */ if (RetVal && (TempPath != NULL)) { if (unlink(TempPath) && (errno != ENOENT)) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, TempPath, errstr); } RetVal = -1; } } /* If output file is a symbolic link, optional resolve the link and modify */ /* the target, instead of removing the link and creating a new regular file */ TargetFN = ipOutFN; if (symbolic_link(ipOutFN) && !RetVal) { ResolveSymlinkResult = 0; /* indicates that TargetFN need not be freed */ if (ipFlag->Follow == SYMLINK_FOLLOW) { ResolveSymlinkResult = ResolveSymbolicLink(ipOutFN, &TargetFN, ipFlag, progname); if (ResolveSymlinkResult < 0) { if (!ipFlag->Quiet) { fprintf(stderr, "%s: ", progname); fprintf(stderr, _("problems resolving symbolic link '%s'\n"), ipOutFN); fprintf(stderr, _(" output file remains in '%s'\n"), TempPath); } RetVal = -1; } } } /* can rename temporary file to output file? */ if (!RetVal) { #ifdef NEED_REMOVE if (unlink(TargetFN) && (errno != ENOENT)) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: %s: %s\n", progname, TargetFN, errstr); } RetVal = -1; } #endif if (rename(TempPath, TargetFN) == -1) { if (!ipFlag->Quiet) { ipFlag->error = errno; errstr = strerror(errno); fprintf(stderr, "%s: ", progname); fprintf(stderr, _("problems renaming '%s' to '%s': %s\n"), TempPath, TargetFN, errstr); #ifdef S_ISLNK if (ResolveSymlinkResult > 0) fprintf(stderr, _(" which is the target of symbolic link '%s'\n"), ipOutFN); #endif fprintf(stderr, _(" output file remains in '%s'\n"), TempPath); } RetVal = -1; } if (ResolveSymlinkResult > 0) free(TargetFN); } free(TempPath); return RetVal; } /* convert stdin to DOS format text and write to stdout * RetVal: 0 if success * -1 otherwise */ int ConvertUnixToDosStdio(CFlag *ipFlag, char *progname) { ipFlag->NewFile = 1; ipFlag->Quiet = 1; ipFlag->KeepDate = 0; ipFlag->Force = 1; #if defined(_WIN32) && !defined(__CYGWIN__) /* stdin and stdout are by default text streams. We need * to set them to binary mode. Otherwise an LF will * automatically be converted to CR-LF on DOS/Windows. * Erwin */ /* POSIX 'setmode' was deprecated by MicroSoft since * Visual C++ 2005. Use ISO C++ conformant '_setmode' instead. */ _setmode(_fileno(stdout), _O_BINARY); _setmode(_fileno(stdin), _O_BINARY); #elif defined(__MSDOS__) || defined(__CYGWIN__) || defined(__OS2__) setmode(fileno(stdout), O_BINARY); setmode(fileno(stdin), O_BINARY); #endif read_bom(stdin, &ipFlag->bomtype); #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16LE)) ipFlag->bomtype = FILE_UTF16LE; if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16BE)) ipFlag->bomtype = FILE_UTF16BE; #endif if ((ipFlag->add_bom) || (ipFlag->bomtype > 0)) fprintf(stdout, "%s", "\xEF\xBB\xBF"); /* UTF-8 BOM */ #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { return (ConvertUnixToDosW(stdin, stdout, ipFlag, progname)); } else { return (ConvertUnixToDos(stdin, stdout, ipFlag, progname)); } #else return (ConvertUnixToDos(stdin, stdout, ipFlag, progname)); #endif } int main (int argc, char *argv[]) { /* variable declarations */ char progname[9]; int ArgIdx; int CanSwitchFileMode; int ShouldExit; int RetVal = 0; int process_options = 1; CFlag *pFlag; char *ptr; #ifdef ENABLE_NLS char localedir[1024]; #endif # ifdef __MINGW64__ int _dowildcard = -1; /* enable wildcard expansion for Win64 */ # endif progname[8] = '\0'; strcpy(progname,"unix2dos"); #ifdef ENABLE_NLS ptr = getenv("DOS2UNIX_LOCALEDIR"); if (ptr == NULL) strcpy(localedir,LOCALEDIR); else { if (strlen(ptr) < sizeof(localedir)) strcpy(localedir,ptr); else { fprintf(stderr,"%s: ",progname); fprintf(stderr, "%s", _("error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n")); strcpy(localedir,LOCALEDIR); } } #endif #if defined(ENABLE_NLS) || (defined(D2U_UNICODE) && !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__)) /* setlocale() is also needed for nl_langinfo() */ setlocale (LC_ALL, ""); #endif #ifdef ENABLE_NLS bindtextdomain (PACKAGE, localedir); textdomain (PACKAGE); #endif /* variable initialisations */ ArgIdx = 0; CanSwitchFileMode = 1; ShouldExit = 0; pFlag = (CFlag*)malloc(sizeof(CFlag)); pFlag->NewFile = 0; pFlag->Quiet = 0; pFlag->KeepDate = 0; pFlag->ConvMode = CONVMODE_ASCII; /* default ascii */ pFlag->FromToMode = FROMTO_UNIX2DOS; /* default unix2dos */ pFlag->NewLine = 0; pFlag->Force = 0; pFlag->Follow = SYMLINK_SKIP; pFlag->status = 0; pFlag->stdio_mode = 1; pFlag->error = 0; #ifdef D2U_UNICODE pFlag->bomtype = FILE_MBS; #endif pFlag->add_bom = 0; if ( ((ptr=strrchr(argv[0],'/')) == NULL) && ((ptr=strrchr(argv[0],'\\')) == NULL) ) ptr = argv[0]; else ptr++; if ((strcmpi("unix2mac", ptr) == 0) || (strcmpi("unix2mac.exe", ptr) == 0)) { pFlag->FromToMode = FROMTO_UNIX2MAC; strcpy(progname,"unix2mac"); } while ((++ArgIdx < argc) && (!ShouldExit)) { /* is it an option? */ if ((argv[ArgIdx][0] == '-') && process_options) { /* an option */ if (strcmp(argv[ArgIdx],"--") == 0) process_options = 0; else if ((strcmp(argv[ArgIdx],"-h") == 0) || (strcmp(argv[ArgIdx],"--help") == 0)) { PrintUsage(progname); return(pFlag->error); } else if ((strcmp(argv[ArgIdx],"-k") == 0) || (strcmp(argv[ArgIdx],"--keepdate") == 0)) pFlag->KeepDate = 1; else if ((strcmp(argv[ArgIdx],"-f") == 0) || (strcmp(argv[ArgIdx],"--force") == 0)) pFlag->Force = 1; else if ((strcmp(argv[ArgIdx],"-s") == 0) || (strcmp(argv[ArgIdx],"--safe") == 0)) pFlag->Force = 0; else if ((strcmp(argv[ArgIdx],"-q") == 0) || (strcmp(argv[ArgIdx],"--quiet") == 0)) pFlag->Quiet = 1; else if ((strcmp(argv[ArgIdx],"-l") == 0) || (strcmp(argv[ArgIdx],"--newline") == 0)) pFlag->NewLine = 1; else if ((strcmp(argv[ArgIdx],"-m") == 0) || (strcmp(argv[ArgIdx],"--add-bom") == 0)) pFlag->add_bom = 1; else if ((strcmp(argv[ArgIdx],"-S") == 0) || (strcmp(argv[ArgIdx],"--skip-symlink") == 0)) pFlag->Follow = SYMLINK_SKIP; else if ((strcmp(argv[ArgIdx],"-F") == 0) || (strcmp(argv[ArgIdx],"--follow-symlink") == 0)) pFlag->Follow = SYMLINK_FOLLOW; else if ((strcmp(argv[ArgIdx],"-R") == 0) || (strcmp(argv[ArgIdx],"--replace-symlink") == 0)) pFlag->Follow = SYMLINK_REPLACE; else if ((strcmp(argv[ArgIdx],"-V") == 0) || (strcmp(argv[ArgIdx],"--version") == 0)) { PrintVersion(progname); #ifdef ENABLE_NLS PrintLocaledir(localedir); #endif return(pFlag->error); } else if ((strcmp(argv[ArgIdx],"-L") == 0) || (strcmp(argv[ArgIdx],"--license") == 0)) { PrintLicense(); return(pFlag->error); } else if (strcmp(argv[ArgIdx],"-ascii") == 0) /* SunOS compatible options */ pFlag->ConvMode = CONVMODE_ASCII; else if (strcmp(argv[ArgIdx],"-7") == 0) pFlag->ConvMode = CONVMODE_7BIT; else if (strcmp(argv[ArgIdx],"-iso") == 0) { pFlag->ConvMode = (int)query_con_codepage(); if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr,_("active code page: %d\n"), pFlag->ConvMode); } if (pFlag->ConvMode < 2) pFlag->ConvMode = CONVMODE_437; } else if (strcmp(argv[ArgIdx],"-437") == 0) pFlag->ConvMode = CONVMODE_437; else if (strcmp(argv[ArgIdx],"-850") == 0) pFlag->ConvMode = CONVMODE_850; else if (strcmp(argv[ArgIdx],"-860") == 0) pFlag->ConvMode = CONVMODE_860; else if (strcmp(argv[ArgIdx],"-863") == 0) pFlag->ConvMode = CONVMODE_863; else if (strcmp(argv[ArgIdx],"-865") == 0) pFlag->ConvMode = CONVMODE_865; else if (strcmp(argv[ArgIdx],"-1252") == 0) pFlag->ConvMode = CONVMODE_1252; #ifdef D2U_UNICODE else if ((strcmp(argv[ArgIdx],"-ul") == 0) || (strcmp(argv[ArgIdx],"--assume-utf16le") == 0)) pFlag->ConvMode = CONVMODE_UTF16LE; else if ((strcmp(argv[ArgIdx],"-ub") == 0) || (strcmp(argv[ArgIdx],"--assume-utf16be") == 0)) pFlag->ConvMode = CONVMODE_UTF16BE; #endif else if ((strcmp(argv[ArgIdx],"-c") == 0) || (strcmp(argv[ArgIdx],"--convmode") == 0)) { if (++ArgIdx < argc) { if (strcmpi(argv[ArgIdx],"ascii") == 0) /* Benjamin Lin's legacy options */ pFlag->ConvMode = CONVMODE_ASCII; else if (strcmpi(argv[ArgIdx], "7bit") == 0) pFlag->ConvMode = CONVMODE_7BIT; else if (strcmpi(argv[ArgIdx], "iso") == 0) { pFlag->ConvMode = (int)query_con_codepage(); if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr,_("active code page: %d\n"), pFlag->ConvMode); } if (pFlag->ConvMode < 2) pFlag->ConvMode = CONVMODE_437; } else if (strcmpi(argv[ArgIdx], "mac") == 0) pFlag->FromToMode = FROMTO_UNIX2MAC; else { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("invalid %s conversion mode specified\n"),argv[ArgIdx]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } } else { ArgIdx--; fprintf(stderr,"%s: ",progname); fprintf(stderr,_("option '%s' requires an argument\n"),argv[ArgIdx]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } } else if ((strcmp(argv[ArgIdx],"-o") == 0) || (strcmp(argv[ArgIdx],"--oldfile") == 0)) { /* last convert not paired */ if (!CanSwitchFileMode) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("target of file %s not specified in new file mode\n"), argv[ArgIdx-1]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } pFlag->NewFile = 0; } else if ((strcmp(argv[ArgIdx],"-n") == 0) || (strcmp(argv[ArgIdx],"--newfile") == 0)) { /* last convert not paired */ if (!CanSwitchFileMode) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("target of file %s not specified in new file mode\n"), argv[ArgIdx-1]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } pFlag->NewFile = 1; } else { /* wrong option */ PrintUsage(progname); ShouldExit = 1; pFlag->error = 1; pFlag->stdio_mode = 0; } } else { pFlag->stdio_mode = 0; /* not an option */ if (pFlag->NewFile) { if (CanSwitchFileMode) CanSwitchFileMode = 0; else { RetVal = ConvertUnixToDosNewFile(argv[ArgIdx-1], argv[ArgIdx], pFlag, progname); if (pFlag->status & NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping %s, not a regular file.\n"), argv[ArgIdx-1]); } } else if (pFlag->status & OUTPUTFILE_SYMLINK) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping %s, output file %s is a symbolic link.\n"), argv[ArgIdx-1], argv[ArgIdx]); } } else if (pFlag->status & INPUT_TARGET_NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), argv[ArgIdx-1]); } } else if (pFlag->status & OUTPUT_TARGET_NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping %s, target of symbolic link %s is not a regular file.\n"), argv[ArgIdx-1], argv[ArgIdx]); } } else if (pFlag->status & BINARY_FILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping binary file %s\n"), argv[ArgIdx-1]); } } else if (pFlag->status & WRONG_CODEPAGE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode); } } else if (pFlag->status & LOCALE_NOT_UTF8) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n"), argv[ArgIdx-1]); } } else if (pFlag->status & WCHAR_T_TOO_SMALL) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), argv[ArgIdx-1], (int)sizeof(wchar_t)); } } else if (pFlag->status & UNICODE_CONVERSION_ERROR) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n"), argv[ArgIdx-1]); } } else { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); if (pFlag->FromToMode == FROMTO_UNIX2MAC) fprintf(stderr, _("converting file %s to file %s in Mac format ...\n"), argv[ArgIdx-1], argv[ArgIdx]); else fprintf(stderr, _("converting file %s to file %s in DOS format ...\n"), argv[ArgIdx-1], argv[ArgIdx]); } if (RetVal) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("problems converting file %s to file %s\n"), argv[ArgIdx-1], argv[ArgIdx]); } } } CanSwitchFileMode = 1; } } else { RetVal = ConvertUnixToDosNewFile(argv[ArgIdx], argv[ArgIdx], pFlag, progname); if (pFlag->status & NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping %s, not a regular file.\n"), argv[ArgIdx]); } } else if (pFlag->status & OUTPUTFILE_SYMLINK) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping symbolic link %s.\n"), argv[ArgIdx]); } } else if (pFlag->status & INPUT_TARGET_NO_REGFILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), argv[ArgIdx]); } } else if (pFlag->status & BINARY_FILE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping binary file %s\n"), argv[ArgIdx]); } } else if (pFlag->status & WRONG_CODEPAGE) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode); } } else if (pFlag->status & LOCALE_NOT_UTF8) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n"), argv[ArgIdx]); } } else if (pFlag->status & WCHAR_T_TOO_SMALL) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), argv[ArgIdx], (int)sizeof(wchar_t)); } } else if (pFlag->status & UNICODE_CONVERSION_ERROR) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred.\n"), argv[ArgIdx]); } } else { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); if (pFlag->FromToMode == FROMTO_UNIX2MAC) fprintf(stderr, _("converting file %s to Mac format ...\n"), argv[ArgIdx]); else fprintf(stderr, _("converting file %s to DOS format ...\n"), argv[ArgIdx]); } if (RetVal) { if (!pFlag->Quiet) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("problems converting file %s\n"), argv[ArgIdx]); } } } } } } /* no file argument, use stdin and stdout */ if (pFlag->stdio_mode) { exit(ConvertUnixToDosStdio(pFlag, progname)); } if (!CanSwitchFileMode) { fprintf(stderr,"%s: ",progname); fprintf(stderr, _("target of file %s not specified in new file mode\n"), argv[ArgIdx-1]); pFlag->error = 1; } return (pFlag->error); } dos2unix-6.0.4/unix2dos.h0000644000175500010010000004515711756222577014521 0ustar waterlanGeen/* * Copyright (C) 2009-2012 Erwin Waterlander * Copyright (C) 1994-1995 Benjamin Lin. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice in the documentation and/or other materials provided with * the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __UNIX2DOS_H #define __UNIX2DOS_H /* ASCII mode. No conversion. */ static int U2DAsciiTable[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x80', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87', '\x88', '\x89', '\x8a', '\x8b', '\x8c', '\x8d', '\x8e', '\x8f', '\x90', '\x91', '\x92', '\x93', '\x94', '\x95', '\x96', '\x97', '\x98', '\x99', '\x9a', '\x9b', '\x9c', '\x9d', '\x9e', '\x9f', '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf', '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf', '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf', '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7', '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf', '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7', '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff', }; /* 7bit mode. */ /* All 8 bit non-ASCII characters are converted to a space (\x20) */ static int U2D7BitTable [256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', }; /* ISO mode. ISO-8859-1 -> CP437 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso437Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\x9b', '\x9c', '\x2e', '\x9d', '\x2e', '\x2e', '\x2e', '\x2e', '\xa6', '\xae', '\xaa', '\x2e', '\x2e', '\x2e', '\xf8', '\xf1', '\xfd', '\x2e', '\x2e', '\xe6', '\x2e', '\xfa', '\x2e', '\x2e', '\xa7', '\xaf', '\xac', '\xab', '\x2e', '\xa8', '\x2e', '\x2e', '\x2e', '\x2e', '\x8e', '\x8f', '\x92', '\x80', '\x2e', '\x90', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa5', '\x2e', '\x2e', '\x2e', '\x2e', '\x99', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x9a', '\x2e', '\x2e', '\xe1', '\x85', '\xa0', '\x83', '\x2e', '\x84', '\x86', '\x91', '\x87', '\x8a', '\x82', '\x88', '\x89', '\x8d', '\xa1', '\x8c', '\x8b', '\x2e', '\xa4', '\x95', '\xa2', '\x93', '\x2e', '\x94', '\xf6', '\x2e', '\x97', '\xa3', '\x96', '\x81', '\x2e', '\x2e', '\x98', }; /* ISO mode. ISO-8859-1 -> CP850 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso850Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\xbd', '\x9c', '\xcf', '\xbe', '\xdd', '\xf5', '\xf9', '\xb8', '\xa6', '\xae', '\xaa', '\xf0', '\xa9', '\xee', '\xf8', '\xf1', '\xfd', '\xfc', '\xef', '\xe6', '\xf4', '\xfa', '\xf7', '\xfb', '\xa7', '\xaf', '\xac', '\xab', '\xf3', '\xa8', '\xb7', '\xb5', '\xb6', '\xc7', '\x8e', '\x8f', '\x92', '\x80', '\xd4', '\x90', '\xd2', '\xd3', '\xde', '\xd6', '\xd7', '\xd8', '\xd1', '\xa5', '\xe3', '\xe0', '\xe2', '\xe5', '\x99', '\x9e', '\x9d', '\xeb', '\xe9', '\xea', '\x9a', '\xed', '\xe8', '\xe1', '\x85', '\xa0', '\x83', '\xc6', '\x84', '\x86', '\x91', '\x87', '\x8a', '\x82', '\x88', '\x89', '\x8d', '\xa1', '\x8c', '\x8b', '\xd0', '\xa4', '\x95', '\xa2', '\x93', '\xe4', '\x94', '\xf6', '\x9b', '\x97', '\xa3', '\x96', '\x81', '\xec', '\xe7', '\x98', }; /* ISO mode. ISO-8859-1 -> CP860 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso860Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\x9b', '\x9c', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa6', '\xae', '\xaa', '\x2e', '\x2e', '\x2e', '\xf8', '\xf1', '\xfd', '\x2e', '\x2e', '\xe6', '\x2e', '\xfa', '\x2e', '\x2e', '\xa7', '\xaf', '\xac', '\xab', '\x2e', '\xa8', '\x91', '\x86', '\x8f', '\x8e', '\x2e', '\x2e', '\x2e', '\x80', '\x92', '\x90', '\x89', '\x2e', '\x98', '\x8b', '\x2e', '\x2e', '\x2e', '\xa5', '\xa9', '\x9f', '\x8c', '\x99', '\x2e', '\x2e', '\x2e', '\x9d', '\x96', '\x2e', '\x9a', '\x2e', '\x2e', '\xe1', '\x85', '\xa0', '\x83', '\x84', '\x2e', '\x2e', '\x2e', '\x87', '\x8a', '\x82', '\x88', '\x2e', '\x8d', '\xa1', '\x2e', '\x2e', '\x2e', '\xa4', '\x95', '\xa2', '\x93', '\x94', '\x2e', '\xf6', '\x2e', '\x97', '\xa3', '\x2e', '\x81', '\x2e', '\x2e', '\x2e', }; /* ISO mode. ISO-8859-1 -> CP863 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso863Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\x9b', '\x9c', '\x98', '\x9d', '\xa0', '\x8f', '\xa4', '\x2e', '\xa6', '\xae', '\xaa', '\x2e', '\x2e', '\xa7', '\xf8', '\xf1', '\xfd', '\xa6', '\xa1', '\xe6', '\x86', '\xfa', '\xa5', '\x2e', '\xa7', '\xaf', '\xac', '\xab', '\xad', '\xa8', '\x8e', '\x2e', '\x84', '\x2e', '\x8e', '\x8f', '\x92', '\x80', '\x91', '\x90', '\x92', '\x94', '\x2e', '\x2e', '\xa8', '\x95', '\x2e', '\xa5', '\x2e', '\x2e', '\x99', '\x2e', '\x99', '\x2e', '\x2e', '\x9d', '\x2e', '\x9e', '\x9a', '\x2e', '\x2e', '\xe1', '\x85', '\xa0', '\x83', '\x2e', '\x84', '\x86', '\x91', '\x87', '\x8a', '\x82', '\x88', '\x89', '\x8d', '\xa1', '\x8c', '\x8b', '\x2e', '\xa4', '\x95', '\xa2', '\x93', '\x2e', '\x94', '\xf6', '\x2e', '\x97', '\xa3', '\x96', '\x81', '\x2e', '\x2e', '\x98', }; /* ISO mode. ISO-8859-1 -> CP865 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso865Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\x2e', '\x9c', '\xaf', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa6', '\xae', '\xaa', '\x2e', '\x2e', '\x2e', '\xf8', '\xf1', '\xfd', '\x2e', '\x2e', '\xe6', '\x2e', '\xfa', '\x2e', '\x2e', '\xa7', '\x2e', '\xac', '\xab', '\x2e', '\xa8', '\x2e', '\x2e', '\x2e', '\x2e', '\x8e', '\x8f', '\x92', '\x80', '\x2e', '\x90', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa5', '\x2e', '\x2e', '\x2e', '\x2e', '\x99', '\x2e', '\x9d', '\x2e', '\x2e', '\x2e', '\x9a', '\x2e', '\x2e', '\xe1', '\x85', '\xa0', '\x83', '\x2e', '\x84', '\x86', '\x91', '\x87', '\x8a', '\x82', '\x88', '\x89', '\x8d', '\xa1', '\x8c', '\x8b', '\x2e', '\xa4', '\x95', '\xa2', '\x93', '\x2e', '\x94', '\xf6', '\x9b', '\x97', '\xa3', '\x96', '\x81', '\x2e', '\x2e', '\x98', }; /* ISO-8859-1 -> CP1252 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso1252Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf', '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf', '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf', '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7', '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf', '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7', '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff', }; #endif dos2unix-6.0.4/vc.mak0000644000175500010010000001137312026356347013662 0ustar waterlanGeen# Makefile for Microsoft Visual C++ # !include version.mk CC = cl.exe /nologo LINK = link.exe /nologo SRCDIR = . DEFINES = /DVER_REVISION=\"$(DOS2UNIX_VERSION)\" /DVER_DATE=\"$(DOS2UNIX_DATE)\" CFLAGS = $(DEFINES) !ifdef DEBUG LDFLAGS = -debug !else LDFLAGS = !endif PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = -win32 UCS = 1 prefix = c:\usr\local all: $(PROGRAMS) $(DOCFILES) dos2unix.exe: dos2unix.obj querycp.obj common.obj $(LINK) $(LDFLAGS) dos2unix.obj querycp.obj common.obj setargv.obj mpr.lib unix2dos.exe: unix2dos.obj querycp.obj common.obj $(LINK) $(LDFLAGS) unix2dos.obj querycp.obj common.obj setargv.obj mpr.lib !if "$(UCS)" == "1" CFLAGS = $(CFLAGS) -DD2U_UNICODE !endif dos2unix.obj : $(SRCDIR)\dos2unix.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h $(CC) -c $(CFLAGS) $(SRCDIR)\dos2unix.c unix2dos.obj : $(SRCDIR)\unix2dos.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h $(CC) -c $(CFLAGS) $(SRCDIR)\unix2dos.c querycp.obj : $(SRCDIR)\querycp.c $(SRCDIR)\querycp.h $(CC) -c $(CFLAGS) $(SRCDIR)\querycp.c common.obj : $(SRCDIR)\common.c $(SRCDIR)\common.h $(CC) -c $(CFLAGS) $(SRCDIR)\common.c mac2unix.exe : dos2unix.exe copy /v dos2unix.exe mac2unix.exe unix2mac.exe : unix2dos.exe copy /v unix2dos.exe unix2mac.exe exec_prefix = $(prefix) bindir = $(exec_prefix)\bin datarootdir = $(prefix)\share datadir = $(datarootdir) !ifndef docsubdir docsubdir = $(PACKAGE)-$(DOS2UNIX_VERSION) !endif docdir = $(datarootdir)\doc\$(docsubdir) INSTALL_OBJS_DOC = README.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt $(DOCFILES) $(prefix): if not exist $@ mkdir $@ $(bindir): $(prefix) if not exist $@ mkdir $@ $(datarootdir): $(prefix) if not exist $@ mkdir $@ $(datarootdir)\doc: $(datarootdir) if not exist $@ mkdir $@ $(docdir): $(datarootdir)\doc if not exist $@ mkdir $@ install: $(PROGRAMS) $(DOCFILES) $(bindir) $(docdir) copy dos2unix.exe $(bindir) copy mac2unix.exe $(bindir) copy unix2dos.exe $(bindir) copy unix2mac.exe $(bindir) copy README.txt $(docdir) copy NEWS.txt $(docdir) copy ChangeLog.txt $(docdir) copy COPYING.txt $(docdir) copy TODO.txt $(docdir) copy BUGS.txt $(docdir) copy man\man1\$(PACKAGE).txt $(docdir) copy man\man1\$(PACKAGE).$(HTMLEXT) $(docdir) man\es\man1\dos2unix.txt : man\es\man1\dos2unix.pod pod2text $** > $(@R).tx1 iconv -f ISO-8859-1 -t UTF-8 $(@R).tx1 > $@ man\nl\man1\dos2unix.txt : man\nl\man1\dos2unix.pod pod2text $** > $(@R).tx1 iconv -f ISO-8859-1 -t UTF-8 $(@R).tx1 > $@ man\man1\dos2unix.txt : man\man1\dos2unix.pod pod2text $** > $@ man\es\man1\dos2unix.$(HTMLEXT) : man\es\man1\dos2unix.pod iconv -f ISO-8859-1 -t UTF-8 $** > $(@R).ut8 pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa" $(@R).ut8 > $@ man\nl\man1\dos2unix.$(HTMLEXT) : man\nl\man1\dos2unix.pod iconv -f ISO-8859-1 -t UTF-8 $** > $(@R).ut8 pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/Mac naar Unix en vice versa tekstbestand formaat omzetter" $(@R).ut8 > $@ man\man1\dos2unix.$(HTMLEXT) : man\man1\dos2unix.pod pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/MAC to UNIX and vice versa text file format converter" $** > $@ TXTFILES = man\man1\$(PACKAGE).txt man\es\man1\$(PACKAGE).txt man\nl\man1\$(PACKAGE).txt HTMLFILES = man\man1\$(PACKAGE).$(HTMLEXT) man\es\man1\$(PACKAGE).$(HTMLEXT) man\nl\man1\$(PACKAGE).$(HTMLEXT) txt : $(TXTFILES) html : $(HTMLFILES) doc : $(DOCFILES) uninstall: -del $(bindir)\dos2unix.exe -del $(bindir)\mac2unix.exe -del $(bindir)\unix2dos.exe -del $(bindir)\unix2mac.exe -rmdir /s /q $(docdir) !ifndef VERSIONSUFFIX VERSIONSUFFIX = -bin !endif !ifndef ZIPFILE ZIPFILE = $(PACKAGE)$(DOS2UNIX_VERSION)$(VERSIONSUFFIX).zip !endif ZIPOBJ = bin\dos2unix.exe bin\mac2unix.exe bin\unix2dos.exe bin\unix2mac.exe share\doc\$(docsubdir) $(ZIPOBJ_EXTRA) DISTCMD = dist.bat dist : @echo cd /d $(prefix) > $(DISTCMD) @echo unix2dos -k share\doc\$(docsubdir)\*.txt >> $(DISTCMD) @echo unix2dos -k share\doc\$(docsubdir)\*.$(HTMLEXT) >> $(DISTCMD) @echo zip -r $(ZIPFILE) $(ZIPOBJ) >> $(DISTCMD) @echo cd /d $(MAKEDIR) >> $(DISTCMD) @echo move $(prefix)\$(ZIPFILE) .. >> $(DISTCMD) .\$(DISTCMD) mostlyclean : -del *.obj -del *.exe -del *.tmp clean : mostlyclean -del $(DOCFILES) -del man\es\man1\*.txt -del man\nl\man1\*.txt -del man\es\man1\*.tx1 -del man\nl\man1\*.tx1 -del man\es\man1\*.$(HTMLEXT) -del man\nl\man1\*.$(HTMLEXT) -del man\es\man1\*.ut8 -del man\nl\man1\*.ut8 -del $(DISTCMD) dos2unix-6.0.4/version.mk0000644000175500010010000000016712260365416014572 0ustar waterlanGeenDOS2UNIX_VERSION = 6.0.4 DOS2UNIX_VERSION_SHORT = 604 DOS2UNIX_DATE = 2013-12-30 DOS2UNIX_AUTHOR = 'Erwin Waterlander' dos2unix-6.0.4/wcc.mif0000755000175500010010000001053312022170652014016 0ustar waterlanGeen!ifeq UCS 1 CFLAGS += -DD2U_UNICODE !endif dos2unix.obj : $(SRCDIR)\dos2unix.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h $(CC) $(CFLAGS) $(SRCDIR)\dos2unix.c unix2dos.obj : $(SRCDIR)\unix2dos.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h $(CC) $(CFLAGS) $(SRCDIR)\unix2dos.c querycp.obj : $(SRCDIR)\querycp.c $(SRCDIR)\querycp.h $(CC) $(CFLAGS) $(SRCDIR)\querycp.c common.obj : $(SRCDIR)\common.c $(SRCDIR)\common.h $(CC) $(CFLAGS) $(SRCDIR)\common.c wildargv.obj : $(WATCOMSRC)\wildargv.c $(CC) $(CFLAGS) $(WATCOMSRC)\wildargv.c mac2unix.exe : dos2unix.exe copy /v dos2unix.exe mac2unix.exe unix2mac.exe : unix2dos.exe copy /v unix2dos.exe unix2mac.exe exec_prefix = $(prefix) bindir = $(exec_prefix)\bin datarootdir = $(prefix)\share datadir = $(datarootdir) !ifndef docsubdir docsubdir = $(PACKAGE)-$(DOS2UNIX_VERSION) !endif docdir = $(datarootdir)\doc\$(docsubdir) INSTALL_OBJS_DOC = README.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt $(DOCFILES) $(prefix): .EXISTSONLY mkdir $@ $(bindir): $(prefix) .EXISTSONLY mkdir $@ $(datarootdir): $(prefix) .EXISTSONLY mkdir $@ $(datarootdir)\doc: $(datarootdir) .EXISTSONLY mkdir $@ $(docdir): $(datarootdir)\doc .EXISTSONLY mkdir $@ install: $(PROGRAMS) $(DOCFILES) $(bindir) $(docdir) .SYMBOLIC copy dos2unix.exe $(bindir) copy mac2unix.exe $(bindir) copy unix2dos.exe $(bindir) copy unix2mac.exe $(bindir) copy README.txt $(docdir) copy NEWS.txt $(docdir) copy ChangeLog.txt $(docdir) copy COPYING.txt $(docdir) copy TODO.txt $(docdir) copy BUGS.txt $(docdir) copy man\man1\dos2unix.txt $(docdir) copy man\man1\dos2unix.$(HTMLEXT) $(docdir) man\es\man1\dos2unix.txt : man\es\man1\dos2unix.pod pod2text $< > $^*.tx1 iconv -f ISO-8859-1 -t UTF-8 $^*.tx1 > $@ man\nl\man1\dos2unix.txt : man\nl\man1\dos2unix.pod pod2text $< > $^*.tx1 iconv -f ISO-8859-1 -t UTF-8 $^*.tx1 > $@ man\man1\dos2unix.txt : man\man1\dos2unix.pod pod2text $< > $@ man\es\man1\dos2unix.$(HTMLEXT) : man\es\man1\dos2unix.pod iconv -f ISO-8859-1 -t UTF-8 $< > $^*.ut8 pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa" $^*.ut8 > $@ man\nl\man1\dos2unix.$(HTMLEXT) : man\nl\man1\dos2unix.pod iconv -f ISO-8859-1 -t UTF-8 $< > $^*.ut8 pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/Mac naar Unix en vice versa tekstbestand formaat omzetter" $^*.ut8 > $@ man\man1\dos2unix.$(HTMLEXT) : man\man1\dos2unix.pod pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/MAC to UNIX and vice versa text file format converter" $< > $@ TXTFILES = man\man1\$(PACKAGE).txt man\es\man1\$(PACKAGE).txt man\nl\man1\$(PACKAGE).txt HTMLFILES = man\man1\$(PACKAGE).$(HTMLEXT) man\es\man1\$(PACKAGE).$(HTMLEXT) man\nl\man1\$(PACKAGE).$(HTMLEXT) txt : $(TXTFILES) .SYMBOLIC html : $(HTMLFILES) .SYMBOLIC doc : $(DOCFILES) .SYMBOLIC uninstall: .SYMBOLIC -del $(bindir)\dos2unix.exe -del $(bindir)\mac2unix.exe -del $(bindir)\unix2dos.exe -del $(bindir)\unix2mac.exe -rmdir /s /q $(docdir) !ifndef VERSIONSUFFIX VERSIONSUFFIX = -bin !endif !ifndef ZIPFILE ZIPFILE = $(PACKAGE)$(DOS2UNIX_VERSION)$(VERSIONSUFFIX).zip !endif ZIPOBJ = bin\dos2unix.exe bin\mac2unix.exe bin\unix2dos.exe bin\unix2mac.exe share\doc\$(docsubdir) $(ZIPOBJ_EXTRA) CURDISK = $+ $(%cdrive): $- CURDIR = $+ $(%cwd) $- !ifdef __OS2__ DISTCMD = dist.cmd !else DISTCMD = dist.bat !endif dist : .SYMBOLIC @%create $(DISTCMD) @%append $(DISTCMD) set PREFIX=$(prefix) @%append $(DISTCMD) set PREFIXDISK=%PREFIX:~0,2% @%append $(DISTCMD) %PREFIXDISK% @%append $(DISTCMD) cd $(prefix) @%append $(DISTCMD) unix2dos -k share\doc\$(docsubdir)\*.txt @%append $(DISTCMD) unix2dos -k share\doc\$(docsubdir)\*.$(HTMLEXT) @%append $(DISTCMD) zip -r $(ZIPFILE) $(ZIPOBJ) @%append $(DISTCMD) $(CURDISK) @%append $(DISTCMD) cd $(CURDIR) @%append $(DISTCMD) move $(prefix)\$(ZIPFILE) .. .\$(DISTCMD) mostlyclean : .SYMBOLIC -del *.obj -del *.exe -del *.SYM -del *.map -del *.ilk -del *.tmp clean : mostlyclean .SYMBOLIC -del $(DOCFILES) -del man\es\man1\*.txt -del man\nl\man1\*.txt -del man\es\man1\*.tx1 -del man\nl\man1\*.tx1 -del man\es\man1\*.$(HTMLEXT) -del man\nl\man1\*.$(HTMLEXT) -del man\es\man1\*.ut8 -del man\nl\man1\*.ut8 dos2unix-6.0.4/wccdos16.mak0000644000175500010010000000221012017400423014652 0ustar waterlanGeen!include version.mk CC = wcc SRCDIR = . DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" CFLAGS = $(DEFINES) -i=$(SRCDIR) -w4 -e25 -zq -od -d2 -bt=dos -ml WATCOMSRC = $(%WATCOM)\src\startup PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = b ZIPFILE = d2u$(DOS2UNIX_VERSION_SHORT)$(VERSIONSUFFIX).zip docsubdir = dos2unix prefix = c:\dos TARGET = dos all: $(PROGRAMS) $(DOCFILES) .SYMBOLIC dos2unix.exe: dos2unix.obj querycp.obj common.obj wildargv.obj @%create dos2unix.lnk @%append dos2unix.lnk FIL dos2unix.obj,querycp.obj,common.obj,wildargv.obj wlink name dos2unix d all SYS $(TARGET) op m op st=32k op maxe=25 op q op symf @dos2unix.lnk del dos2unix.lnk unix2dos.exe: unix2dos.obj querycp.obj common.obj wildargv.obj @%create unix2dos.lnk @%append unix2dos.lnk FIL unix2dos.obj,querycp.obj,common.obj,wildargv.obj wlink name unix2dos d all SYS $(TARGET) op m op st=32k op maxe=25 op q op symf @unix2dos.lnk del unix2dos.lnk !include wcc.mif dos2unix-6.0.4/wccdos32.mak0000644000175500010010000000230412017400423014654 0ustar waterlanGeen!include version.mk CC = wcc386 SRCDIR = . DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" CFLAGS = $(DEFINES) -i=$(SRCDIR) -w4 -e25 -zq -od -d2 -5r -bt=dos -mf WATCOMSRC = $(%WATCOM)\src\startup PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = pm ZIPFILE = d2u$(DOS2UNIX_VERSION_SHORT)$(VERSIONSUFFIX).zip ZIPOBJ_EXTRA = bin\cwstub.exe docsubdir = dos2unix prefix = c:\dos32 TARGET = causeway all: $(PROGRAMS) $(DOCFILES) .SYMBOLIC dos2unix.exe: dos2unix.obj querycp.obj common.obj wildargv.obj @%create dos2unix.lnk @%append dos2unix.lnk FIL dos2unix.obj,querycp.obj,common.obj,wildargv.obj wlink name dos2unix d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @dos2unix.lnk del dos2unix.lnk unix2dos.exe: unix2dos.obj querycp.obj common.obj wildargv.obj @%create unix2dos.lnk @%append unix2dos.lnk FIL unix2dos.obj,querycp.obj,common.obj,wildargv.obj wlink name unix2dos d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @unix2dos.lnk del unix2dos.lnk !include wcc.mif dos2unix-6.0.4/wccos2.mak0000644000175500010010000000214312016745310014434 0ustar waterlanGeen!include version.mk CC = wcc386 SRCDIR = . DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" CFLAGS = $(DEFINES) -i=$(SRCDIR) -i$(%WATCOM)\h\os2 -w4 -e25 -zq -od -d2 -6r -bt=os2 -mf WATCOMSRC = $(%WATCOM)\src\startup PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = -os2 prefix = c:\usr TARGET = os2v2 all: $(PROGRAMS) $(DOCFILES) .SYMBOLIC dos2unix.exe: dos2unix.obj querycp.obj common.obj wildargv.obj @%create dos2unix.lnk @%append dos2unix.lnk FIL dos2unix.obj,querycp.obj,common.obj,wildargv.obj wlink name dos2unix d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @dos2unix.lnk del dos2unix.lnk unix2dos.exe: unix2dos.obj querycp.obj common.obj wildargv.obj @%create unix2dos.lnk @%append unix2dos.lnk FIL unix2dos.obj,querycp.obj,common.obj,wildargv.obj wlink name unix2dos d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @unix2dos.lnk del unix2dos.lnk !include wcc.mif dos2unix-6.0.4/wccwin32.mak0000644000175500010010000000225512016510711014672 0ustar waterlanGeen!include version.mk CC = wcc386 SRCDIR = . DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" CFLAGS = $(DEFINES) -i=$(SRCDIR) -w4 -e25 -zq -od -d2 -5r -bt=nt -mf WATCOMSRC = $(%WATCOM)\src\startup PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = -win32 UCS = 1 prefix = c:\usr\local TARGET = nt all: $(PROGRAMS) $(DOCFILES) .SYMBOLIC dos2unix.exe: dos2unix.obj querycp.obj common.obj wildargv.obj @%create dos2unix.lnk @%append dos2unix.lnk FIL dos2unix.obj,querycp.obj,common.obj,wildargv.obj @%append dos2unix.lnk library mpr.lib wlink name dos2unix d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @dos2unix.lnk del dos2unix.lnk unix2dos.exe: unix2dos.obj querycp.obj common.obj wildargv.obj @%create unix2dos.lnk @%append unix2dos.lnk FIL unix2dos.obj,querycp.obj,common.obj,wildargv.obj @%append unix2dos.lnk library mpr.lib wlink name unix2dos d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @unix2dos.lnk del unix2dos.lnk !include wcc.mif