167 lines
5.8 KiB
Diff
167 lines
5.8 KiB
Diff
diff --no-dereference -Naur -- nano.normalized/config.sub nano.srctix/config.sub
|
|
--- nano.normalized/config.sub 2016-09-09 07:06:00.000000000 +0200
|
|
+++ nano.srctix/config.sub 2016-10-30 21:44:49.674752871 +0100
|
|
@@ -1373,7 +1373,7 @@
|
|
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
|
| -sym* | -kopensolaris* | -plan9* \
|
|
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
|
- | -aos* | -aros* \
|
|
+ | -aos* | -aros* | -sortix* \
|
|
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
|
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
|
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
|
diff --no-dereference -Naur -- nano.normalized/configure nano.srctix/configure
|
|
--- nano.normalized/configure 2016-10-29 11:17:58.000000000 +0200
|
|
+++ nano.srctix/configure 2016-10-30 21:49:17.899747198 +0100
|
|
@@ -8675,6 +8675,7 @@
|
|
# Extract the first word of "${ac_tool_prefix}ncursesw5-config", so it can be a program name with args.
|
|
set dummy ${ac_tool_prefix}ncursesw5-config; ac_word=$2
|
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
|
+ac_cv_prog_NCURSESW_CONFIG=false
|
|
$as_echo_n "checking for $ac_word... " >&6; }
|
|
if ${ac_cv_prog_NCURSESW_CONFIG+:} false; then :
|
|
$as_echo_n "(cached) " >&6
|
|
diff --no-dereference -Naur -- nano.normalized/src/files.c nano.srctix/src/files.c
|
|
--- nano.normalized/src/files.c 2016-10-29 11:17:49.000000000 +0200
|
|
+++ nano.srctix/src/files.c 2016-10-30 21:56:31.228429240 +0100
|
|
@@ -1501,10 +1501,12 @@
|
|
if (tmpdir_env != NULL)
|
|
full_tempdir = check_writable_directory(tmpdir_env);
|
|
|
|
+#ifdef P_tmpdir
|
|
/* If $TMPDIR is unset, empty, or not a writable directory, and
|
|
* full_tempdir is NULL, try P_tmpdir instead. */
|
|
if (full_tempdir == NULL)
|
|
full_tempdir = check_writable_directory(P_tmpdir);
|
|
+#endif
|
|
|
|
/* if P_tmpdir is NULL, use /tmp. */
|
|
if (full_tempdir == NULL)
|
|
diff --no-dereference -Naur -- nano.normalized/src/Makefile.in nano.srctix/src/Makefile.in
|
|
--- nano.normalized/src/Makefile.in 2016-10-29 11:17:57.000000000 +0200
|
|
+++ nano.srctix/src/Makefile.in 2016-11-03 08:49:47.812102726 +0100
|
|
@@ -559,6 +559,7 @@
|
|
distclean: distclean-am
|
|
-rm -rf ./$(DEPDIR)
|
|
-rm -f Makefile
|
|
+ -rm -f revision.h
|
|
distclean-am: clean-am distclean-compile distclean-generic \
|
|
distclean-tags
|
|
|
|
diff --no-dereference -Naur -- nano.normalized/src/rcfile.c nano.srctix/src/rcfile.c
|
|
--- nano.normalized/src/rcfile.c 2016-10-26 09:41:15.000000000 +0200
|
|
+++ nano.srctix/src/rcfile.c 2016-11-03 20:54:47.204159355 +0100
|
|
@@ -23,7 +23,9 @@
|
|
|
|
#include "proto.h"
|
|
|
|
+#if defined(__has_include) && __has_include(<glob.h>)
|
|
#include <glob.h>
|
|
+#endif
|
|
#include <stdarg.h>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
@@ -223,13 +225,35 @@
|
|
* null-terminate it, and return a pointer to the /next/ word. */
|
|
char *parse_next_regex(char *ptr)
|
|
{
|
|
+ char* outptr = ptr;
|
|
+ int escaped = 0;
|
|
+ char c;
|
|
+ size_t bracket = 0;
|
|
+
|
|
assert(ptr != NULL);
|
|
|
|
- /* Continue until the end of line, or until a " followed by a
|
|
- * blank character or the end of line. */
|
|
- while (*ptr != '\0' && (*ptr != '"' ||
|
|
- (*(ptr + 1) != '\0' && !isblank(*(ptr + 1)))))
|
|
- ptr++;
|
|
+ /* PATCH: This fixes issues in the nanorc parser because the Sortix regcomp
|
|
+ does not support \" and \' (just use " and ' instead). */
|
|
+ while ((c = *ptr)) {
|
|
+ if (!escaped && !bracket && c == '"' &&
|
|
+ (!ptr[1] || isspace((unsigned char) ptr[1])) )
|
|
+ break;
|
|
+ if (escaped && c != '"' && c != '\'')
|
|
+ *outptr++ = '\\';
|
|
+ if (c == '\\' && !escaped && !bracket)
|
|
+ escaped = 1;
|
|
+ else if (c == '[' && !escaped) {
|
|
+ bracket++;
|
|
+ *outptr++ = c;
|
|
+ } else if (bracket && c == ']' && !escaped) {
|
|
+ bracket--;
|
|
+ *outptr++ = c;
|
|
+ } else {
|
|
+ *outptr++ = c;
|
|
+ escaped = 0;
|
|
+ }
|
|
+ ptr++;
|
|
+ }
|
|
|
|
assert(*ptr == '"' || *ptr == '\0');
|
|
|
|
@@ -240,7 +264,8 @@
|
|
}
|
|
|
|
/* Null-terminate and advance ptr. */
|
|
- *ptr++ = '\0';
|
|
+ *outptr = '\0';
|
|
+ ptr++;
|
|
|
|
while (isblank(*ptr))
|
|
ptr++;
|
|
@@ -570,8 +595,11 @@
|
|
void parse_includes(char *ptr)
|
|
{
|
|
char *option, *nanorc_save = nanorc, *expanded;
|
|
- size_t lineno_save = lineno, i;
|
|
+ size_t lineno_save = lineno;
|
|
+#if defined(__has_include) && __has_include(<glob.h>)
|
|
+ size_t i;
|
|
glob_t files;
|
|
+#endif
|
|
|
|
option = ptr;
|
|
if (*option == '"')
|
|
@@ -581,6 +609,7 @@
|
|
/* Expand tildes first, then the globs. */
|
|
expanded = real_dir_from_tilde(option);
|
|
|
|
+#if defined(__has_include) && __has_include(<glob.h>)
|
|
if (glob(expanded, GLOB_ERR|GLOB_NOSORT, NULL, &files) == 0) {
|
|
for (i = 0; i < files.gl_pathc; ++i)
|
|
parse_one_include(files.gl_pathv[i]);
|
|
@@ -589,6 +618,9 @@
|
|
strerror(errno));
|
|
|
|
globfree(&files);
|
|
+#else
|
|
+ parse_one_include(expanded);
|
|
+#endif
|
|
free(expanded);
|
|
|
|
/* We're done with the included file(s). Restore the original
|
|
diff --no-dereference -Naur -- nano.normalized/src/winio.c nano.srctix/src/winio.c
|
|
--- nano.normalized/src/winio.c 2016-10-26 09:41:33.000000000 +0200
|
|
+++ nano.srctix/src/winio.c 2016-10-30 23:24:39.910552135 +0100
|
|
@@ -2274,7 +2274,7 @@
|
|
if (margin > 0) {
|
|
wattron(edit, interface_color_pair[LINE_NUMBER]);
|
|
if (last_drawn_line != fileptr->lineno || last_line_y >= line)
|
|
- mvwprintw(edit, line, 0, "%*i", margin - 1, fileptr->lineno);
|
|
+ mvwprintw(edit, line, 0, "%*zi", margin - 1, fileptr->lineno);
|
|
else
|
|
mvwprintw(edit, line, 0, "%*s", margin - 1, " ");
|
|
wattroff(edit, interface_color_pair[LINE_NUMBER]);
|
|
diff --no-dereference -Naur -- nano.normalized/tixbuildinfo nano.srctix/tixbuildinfo
|
|
--- nano.normalized/tixbuildinfo 1970-01-01 01:00:00.000000000 +0100
|
|
+++ nano.srctix/tixbuildinfo 2016-11-03 08:53:38.730536482 +0100
|
|
@@ -0,0 +1,5 @@
|
|
+tix.version=1
|
|
+tix.class=srctix
|
|
+pkg.name=nano
|
|
+pkg.build-libraries=libiconv? gettext? libcurses libmagic? libz?
|
|
+pkg.build-system=configure
|