new code in read_line and write_file. New cmdline flag
(-D --dos) to automatically write the file in DOS format,
regardless of the original format.
+ - Mac file writing supported too. Flag -M, --mac. No toggle
+ as of yet.
- nano.c:
main()
- Added vars oldcurrent and oldcurrent_x to check whether cursor
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
.SUFFIXES:
.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
$(ACLOCAL_M4): configure.in
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
- test -z "$ii" \
+ test -z "$$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$/$$file $(distdir)/$$file; \
+ cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-dnl aclocal.m4 generated automatically by aclocal 1.4
+dnl aclocal.m4 generated automatically by aclocal 1.4-p4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
-/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
+/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Read the entire file into file struct */
while ((size = read_byte(fd, filename, input)) > 0) {
linetemp = 0;
- if (input[0] == '\n') {
+ if (input[0] == '\n'
+#ifndef NANO_SMALL
+ || (ISSET(MAC_FILE) && input[0] == '\r')
+#endif
+ ) {
fileptr = read_line(buf, fileptr, &line1ins);
num_lines++;
buf[0] = 0;
#endif
}
#ifndef NANO_SMALL
- if (ISSET(DOS_FILE))
+ if (ISSET(DOS_FILE) || ISSET(MAC_FILE))
write(fd, "\r", 1);
+
+ if (!ISSET(MAC_FILE))
#endif
- write(fd, "\n", 1);
+ write(fd, "\n", 1);
fileptr = fileptr->next;
lineswritten++;
return -1;
}
}
+
+ if (!ISSET(MAC_FILE))
#endif
- size = write(fd, "\n", 1);
- lineswritten++;
- if (size == -1) {
- statusbar(_("Could not open file for writing: %s"),
+ {
+ size = write(fd, "\n", 1);
+ lineswritten++;
+ if (size == -1) {
+ statusbar(_("Could not open file for writing: %s"),
strerror(errno));
- return -1;
+ return -1;
+ }
}
}
}
(_
(" -F --multibuffer Enable multiple file buffers\n"));
#endif
+#ifndef NANO_SMALL
+ printf
+ (_
+ (" -M --mac Write file in Mac format\n"));
+#endif
#ifdef HAVE_REGEX_H
printf(_
(" -R --regexp Use regular expressions for search\n"));
#endif
#ifdef ENABLE_MULTIBUFFER
printf(_(" -F Enable multiple file buffers\n"));
+#endif
+#ifndef NANO_SMALL
+ printf(_(" -M Write file in Mac format\n"));
#endif
printf(_(" -T [num] Set width of a tab to num\n"));
printf(_(" -R Use regular expressions for search\n"));
#ifndef NANO_SMALL
{"cut", 0, 0, 'k'},
{"dos", 0, 0, 'D'},
+ {"mac", 0, 0, 'M'},
{"autoindent", 0, 0, 'i'},
#endif
{"tempfile", 0, 0, 't'},
#endif /* ENABLE_NANORC */
#ifdef HAVE_GETOPT_LONG
- while ((optchr = getopt_long(argc, argv, "h?DFRT:Vabcefgijklmo:pr:s:tvwxz",
+ while ((optchr = getopt_long(argc, argv, "h?DFMRT:Vabcefgijklmo:pr:s:tvwxz",
long_options, &option_index)) != EOF) {
#else
while ((optchr =
- getopt(argc, argv, "h?DFRT:Vabcefgijklmo:pr:s:tvwxz")) != EOF) {
+ getopt(argc, argv, "h?DFMRT:Vabcefgijklmo:pr:s:tvwxz")) != EOF) {
#endif
switch (optchr) {
SET(MULTIBUFFER);
break;
#endif
-
+#ifndef NANO_SMALL
+ case 'M':
+ SET(MAC_FILE);
+ break;
+#endif
case 'T':
tabsize = atoi(optarg);
if (tabsize <= 0) {
#define MULTIBUFFER (1<<19)
#define CLEAR_BACKUPSTRING (1<<20)
#define DOS_FILE (1<<21)
+#define MAC_FILE (1<<22)
/* Control key sequences, changing these would be very very bad */