1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-11-19 19:15:55 -05:00
Commit Graph

73 Commits

Author SHA1 Message Date
267c218b9b Only display program name and version on the bottom mode line. 2015-04-19 11:59:31 +08:00
4ac1913cd1 CID 39934: Fix potential buffer overflow. 2015-04-13 18:26:06 +08:00
2b8992350d Avoid unnecessary sprintf & buffers when updating message or status line. 2015-02-15 16:10:44 +08:00
bb44fc57ad Limit the scope of mlforce to eval. 2015-02-13 17:46:42 +08:00
2953531913 Insure that mlwrite( "") as same effect as mlerase(). 2015-02-13 15:33:21 +08:00
e13bc9ca7e Version 4.2
Consistent display of µEMACS as program name among
- ue --version
- on status bar
- insert-string $progname
- write-message $progname (FIX).
2015-02-12 13:15:45 +08:00
7da7916b28 describe-key displays keycode in hexadecimal.
mlwrite assume parameter is unsigned int when doing %x format.
ostring output bytes > 0x7F as unsigned char.
2015-02-09 19:27:49 +08:00
4cbf1e9ae1 Review cursor movement in presence of mixed latin1/unicode encoding. 2015-02-04 12:37:57 +08:00
83b323272d Put back the Micro in uEMACS both in status line and version string (ue --version). 2015-02-02 19:20:48 +08:00
7c74bfdc1a Align cursor movement according to character representation (^c and \nn). 2015-01-31 07:57:26 +08:00
7018880551 Review/Retest mlerase when erase to eol is not available. 2015-01-23 13:13:07 +08:00
5a235ecf8c Insure that last character of the message line is displayed. 2015-01-23 12:13:52 +08:00
09d5907f9e Insure writing on message line does not exceed terminal size. 2015-01-22 20:26:22 +08:00
daa6395128 Minor review of mlerase in relationship to usage in mlwrite. 2015-01-22 17:36:11 +08:00
891f4c3238 Restrict scope of mlputs to display. 2015-01-21 17:16:43 +08:00
fbfaa29497 Add %B in string format of mlwrite to ring a bell. 2015-01-21 14:12:24 +08:00
434c9ba7ab Review mlforce to avoid necessity to double '%' in input string, thus avoiding potential buffer overflow in caller functions (mdbugout and write-message). 2015-01-15 17:57:12 +08:00
48ea9279a6 Allocate video buffers based on MAXROW/MAXCOL even if os window is smaller at initialization. 2015-01-02 20:26:34 +08:00
923d7bdc8e Insure resizing screen commands are aligned with OS window sizes. 2015-01-02 17:50:31 +08:00
20d21435e0 Rebuild on Linux.
Remove warnings on system and write call without return code check.
2015-01-02 14:20:07 +08:00
3be85dec65 Recompile under MinGW32 with base framework for implementing kbd/screen (mingw32 + wscreen). 2014-12-22 20:58:10 +08:00
da813d2efc Partial move configuration options out of estruct.h. 2014-12-22 17:44:52 +08:00
2fe2d9c153 Finish move of globals into input and random.
Remove globals.
2014-12-22 17:43:53 +08:00
f03b7c97e3 Move globals variables to related modules. 2014-12-22 17:42:27 +08:00
0f6ff70764 Move variables from globals to corresponding modules. 2014-12-22 17:41:59 +08:00
80256bdd6d Remove edef.h, obsoleted by globals.h. 2014-12-22 17:41:40 +08:00
dc3e8984ab Move standard includes of stdlib and string from edef.h. 2014-12-22 17:41:07 +08:00
d6e3df6ff3 Move global window pointers to window and global keyboard variables to input. 2014-12-22 17:40:38 +08:00
526c1e3baa Review global literals for mode names and color names. 2014-12-22 17:38:58 +08:00
63e2f82211 Move global variable to module scope (display, exec, input). 2014-12-22 17:38:48 +08:00
9780b4ce16 Extract Struct terminal from estruct to terminal.h implemented by tcap. 2014-12-22 17:36:24 +08:00
87cd40ce6a Extract struct buffer and struct window from estruct.h. 2014-12-22 16:11:13 +08:00
45ea35f2a7 Move dependencies from display to log. 2014-12-22 16:09:23 +08:00
245c4a0477 Remove dependencies from line to display: Move rdonly from display to loc and create instantiable function logger( retcode, beep, string). 2014-12-22 16:09:15 +08:00
e83feafda1 Minimize Cygwin64 changes & use __unix__ instead of CYGWIN. 2014-12-22 16:08:47 +08:00
15012326db Compile under Cygwin64. 2014-12-22 16:08:37 +08:00
287c55cbac Insure consistency when REVSTA is off (no reverse status bar). 2014-12-22 16:08:04 +08:00
a96f1b5f85 Move rdonly and reterr from main to display to avoid dependencies to main. 2014-12-22 15:43:35 +08:00
04264b4d27 Start clean up of lock/pklock dependencies. 2014-12-22 15:06:37 +08:00
0e9fc236f9 display depends on window instead of efunc. 2014-12-22 14:45:37 +08:00
86d5b10fa9 fileio depends on display instead of efunc. 2014-12-22 14:45:16 +08:00
86afdef45e refactor handling of version and program name strings. 2014-12-22 14:43:23 +08:00
Linus Torvalds
25f0141df1 Avoid memory access errors if llength() overflows
llength() is currently a 'short' which can overflow and result in signed
numbers if line lengths are larger than 32k.  We'll fix the overflow
separately, but before we do that, just use a signed int to hold the
value so that we don't overrun memory allocations when we converted that
negative number to a large positive unsigned integer.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-22 14:29:43 -08:00
Linus Torvalds
1edeced67c Fix vtputc() and simplify show_line by using it again
This re-introduces vtputc() as the way to show characters, which
reinstates the control character handing, and simplifies show_line() in
the process.

vtputc now takes an "int" that is either a unicode character or a signed
char (so negative values in the range [-1, -128] are considered to be
the same as [128, 255]).  This allows us to use it regardless of what
the source of data is.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-11 11:23:32 -07:00
Linus Torvalds
4bccfab632 Make 'show_line()' do proper TAB handling
The TAB handling got broken by commit cee00b0efb ("Show UTF-8 input as
UTF-8 output") when it stopped doing things one byte at a time.

I'm sure the other special character cases are broken too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-11 01:22:32 -07:00
Linus Torvalds
6b793211c2 Make cursor movement (largely) understand UTF-8 character boundaries
Ok, so it may do odd things if it's not truly utf-8, and when moving up
and down lines that have utf-8 the cursor moves oddly (because the byte
offset within the line stays constant, rather than the character
offset), but with this you can actually open the UTF8 example file and
move around it, and at least some of the movement makes sense.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10 16:40:36 -07:00
Linus Torvalds
e62cdf04cf Split up the utf8 helper functions into a file of their own
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10 16:21:35 -07:00
Linus Torvalds
cee00b0efb Show UTF-8 input as UTF-8 output
.. by doing the stupid "convert to unicode value and back" model.

This actually populates the 'struct video' array with the unicode
values, so UTF8 input actually shows correctly.  In particular, the nice
test-file (UTF-8-demo.txt) shows up not as garbage, but as the UTF-8 it
is.

HOWEVER!

Since the *editing* doesn't know about UTF-8, and considers it just a
stream of bytes, the end result is not actually a usable utf-8 editor.
So don't get too excited yet: this is just a partial step to "actually
edit utf8 data"

NOTE NOTE NOTE! If the character buffer contains Latin1, we will
transform that Latin1 to unicode, and then output it as UTF8.  And we
will edit it correctly as the character-by-character data.  Also, we
still do the "UTF8 to Latin1" translation on *input*, so with this
commit we can actually continue to *edit* Latin1 text.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10 15:08:17 -07:00
Linus Torvalds
e8f984a1b0 Make the 'struct video' contain an array of unicode characters rather than bytes
This is disgusting.  And quite frankly, it's debatable whether this will
ever work.  The "line" structure is still just an array of characters,
so that has to work with utf-8.

But the 'struct video' thing is what represents the actual screen
rectangle, and is fixed-size by the size of the screen.  So making it
contain actual 32-bit unicode characters *may* make sense.

Right now we translate things the same way we always used to, though, so
utf-8 in 'struct line' will not be translated to the proper unicode
array, but to the bytes of the utf-8 representation.  So this really
doesn't improve anything per se yet, just expands the memory use of the
video array.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10 14:24:23 -07:00
Linus Torvalds
2dddd4f970 Show lines with a single helper function, not one byte at a time
Let's see how hard it is to show UTF-8 characters properly.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10 13:38:41 -07:00