diff options
author | cracauer <cracauer@FreeBSD.org> | 2003-07-02 05:59:54 +0800 |
---|---|---|
committer | cracauer <cracauer@FreeBSD.org> | 2003-07-02 05:59:54 +0800 |
commit | 8e1a33ec4a4444ac6cb7fd88555a852e55cebe5e (patch) | |
tree | c7f3661b1815b06de4df435aea998c15e891fbb8 /editors | |
parent | e611fd9c48d093c546c2c5b641be829f7f6b9640 (diff) | |
download | freebsd-ports-gnome-8e1a33ec4a4444ac6cb7fd88555a852e55cebe5e.tar.gz freebsd-ports-gnome-8e1a33ec4a4444ac6cb7fd88555a852e55cebe5e.tar.zst freebsd-ports-gnome-8e1a33ec4a4444ac6cb7fd88555a852e55cebe5e.zip |
Fix a long-term problem: shell-mode would not open a new shell fo
shell-mode on FreeBSD once a number of ttys were taken, it wouldn't
find the next free one where xterm and everybody else would.
Teach it to walk the list of possible FreeBSD ttys correctly.
This code is evil, I'm only doing it because emacs-21 is *really* evil
and I didn't port all of my .emacs to xemacs yet...
Diffstat (limited to 'editors')
-rw-r--r-- | editors/emacs20/files/patch-ch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/editors/emacs20/files/patch-ch b/editors/emacs20/files/patch-ch new file mode 100644 index 000000000000..f68aed045a8d --- /dev/null +++ b/editors/emacs20/files/patch-ch @@ -0,0 +1,42 @@ +--- src/process.c.orig Tue Jul 1 16:24:08 2003 ++++ src/process.c Tue Jul 1 16:24:42 2003 +@@ -400,6 +400,14 @@ + + #ifdef HAVE_PTYS + ++char to_tty_char(int i) ++{ ++ if (i < 10) ++ return '0' + i; ++ else ++ return 'a' + i - 10; ++} ++ + /* Open an available pty, returning a file descriptor. + Return -1 on failure. + The file name of the terminal corresponding to the pty +@@ -423,13 +431,13 @@ + PTY_ITERATION + #else + for (c = FIRST_PTY_LETTER; c <= 'z'; c++) +- for (i = 0; i < 16; i++) ++ for (i = 0; i < 'z' - 'a' + 1 + 10; i++) + #endif + { + #ifdef PTY_NAME_SPRINTF + PTY_NAME_SPRINTF + #else +- sprintf (pty_name, "/dev/pty%c%x", c, i); ++ sprintf (pty_name, "/dev/pty%c%c", c, to_tty_char(i)); + #endif /* no PTY_NAME_SPRINTF */ + + #ifdef PTY_OPEN +@@ -466,7 +474,7 @@ + #ifdef PTY_TTY_NAME_SPRINTF + PTY_TTY_NAME_SPRINTF + #else +- sprintf (pty_name, "/dev/tty%c%x", c, i); ++ sprintf (pty_name, "/dev/tty%c%c", c, to_tty_char(i)); + #endif /* no PTY_TTY_NAME_SPRINTF */ + #ifndef UNIPLUS + if (access (pty_name, 6) != 0) |