mirror of
https://github.com/troglobit/libite.git
synced 2026-10-14 10:19:31 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6daebf4ea4 | ||
|
|
4d6e3e060e | ||
|
|
86eef8e38d | ||
|
|
d5d3dafc78 | ||
|
|
2534c398ea | ||
|
|
3691044007 | ||
|
|
6770dad0cc | ||
|
|
ef0db5e766 | ||
|
|
485463c70e | ||
|
|
4b77eb1423 | ||
|
|
0b54dc6015 |
No files matched your search
+17
-1
@@ -4,6 +4,21 @@ Change Log
|
|||||||
All notable changes to the project are documented in this file.
|
All notable changes to the project are documented in this file.
|
||||||
|
|
||||||
|
|
||||||
|
[v1.9.3][] - 2017-10-24
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
- `initscr()`, use stdout, not stderr, like the rest of the
|
||||||
|
`conio.h` macros. Also, stderr may be redirected by user
|
||||||
|
- `tree()`, update unit test, use standard directries
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
- `initscr()`, verify that both stdin and stdout are real TTYs
|
||||||
|
before messing up output or blocking on input for the user
|
||||||
|
- `tree()`, increase internal buffer slightly, output may be
|
||||||
|
truncated otherwise. Found by GCC 7.2
|
||||||
|
|
||||||
|
|
||||||
[v1.9.2][] - 2017-07-09
|
[v1.9.2][] - 2017-07-09
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
@@ -260,7 +275,8 @@ problems this may cause!
|
|||||||
Initial extraction of frog DNA from [Finit][]. See [README][] for API details.
|
Initial extraction of frog DNA from [Finit][]. See [README][] for API details.
|
||||||
|
|
||||||
|
|
||||||
[UNRELEASED]: https://github.com/troglobit/libite/compare/v1.9.1...HEAD
|
[UNRELEASED]: https://github.com/troglobit/libite/compare/v1.9.2...HEAD
|
||||||
|
[v1.9.2]: https://github.com/troglobit/libite/compare/v1.9.1...v1.9.2
|
||||||
[v1.9.1]: https://github.com/troglobit/libite/compare/v1.9.0...v1.9.1
|
[v1.9.1]: https://github.com/troglobit/libite/compare/v1.9.0...v1.9.1
|
||||||
[v1.9.0]: https://github.com/troglobit/libite/compare/v1.8.3...v1.9.0
|
[v1.9.0]: https://github.com/troglobit/libite/compare/v1.8.3...v1.9.0
|
||||||
[v1.8.3]: https://github.com/troglobit/libite/compare/v1.8.2...v1.8.3
|
[v1.8.3]: https://github.com/troglobit/libite/compare/v1.8.2...v1.8.3
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ libite_la_SOURCES = chomp.c copyfile.c dir.c fexist.c fisdir.c fmode.c fparsel
|
|||||||
|
|
||||||
libite_la_CPPFLAGS = -D_GNU_SOURCE
|
libite_la_CPPFLAGS = -D_GNU_SOURCE
|
||||||
libite_la_CFLAGS = -W -Wall -Wextra
|
libite_la_CFLAGS = -W -Wall -Wextra
|
||||||
libite_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:0:0
|
libite_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:1:0
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = libite.pc
|
pkgconfig_DATA = libite.pc
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
AC_INIT(libite, 1.9.2, https://github.com/troglobit/libite/issues)
|
AC_INIT(libite, 1.9.3, https://github.com/troglobit/libite/issues)
|
||||||
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
|
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
|
||||||
AM_SILENT_RULES([yes])
|
AM_SILENT_RULES([yes])
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
#define CONIO_H_
|
#define CONIO_H_
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <termios.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
/* Attributes */
|
/* Attributes */
|
||||||
#define RESETATTR 0
|
#define RESETATTR 0
|
||||||
@@ -53,17 +55,17 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Esc[2JEsc[1;1H - Clear screen and move cursor to 1,1 (upper left) pos. */
|
/* Esc[2JEsc[1;1H - Clear screen and move cursor to 1,1 (upper left) pos. */
|
||||||
#define clrscr() fputs ("\033[2J\033[1;1H", stdout)
|
#define clrscr() fputs("\033[2J\033[1;1H", stdout)
|
||||||
/* Esc[K - Erases from the current cursor position to the end of the current line. */
|
/* Esc[K - Erases from the current cursor position to the end of the current line. */
|
||||||
#define clreol() fputs ("\033[K", stdout)
|
#define clreol() fputs("\033[K", stdout)
|
||||||
/* Esc[2K - Erases the entire current line. */
|
/* Esc[2K - Erases the entire current line. */
|
||||||
#define delline() fputs ("\033[2K", stdout)
|
#define delline() fputs("\033[2K", stdout)
|
||||||
/* Esc[Line;ColumnH - Moves the cursor to the specified position (coordinates) */
|
/* Esc[Line;ColumnH - Moves the cursor to the specified position (coordinates) */
|
||||||
#define gotoxy(x,y) fprintf(stdout, "\033[%d;%dH", y, x)
|
#define gotoxy(x,y) fprintf(stdout, "\033[%d;%dH", y, x)
|
||||||
/* Esc[?25l (lower case L) - Hide Cursor */
|
/* Esc[?25l (lower case L) - Hide Cursor */
|
||||||
#define hidecursor() fputs ("\033[?25l", stdout)
|
#define hidecursor() fputs("\033[?25l", stdout)
|
||||||
/* Esc[?25h (lower case H) - Show Cursor */
|
/* Esc[?25h (lower case H) - Show Cursor */
|
||||||
#define showcursor() fputs ("\033[?25h", stdout)
|
#define showcursor() fputs("\033[?25h", stdout)
|
||||||
|
|
||||||
/* Esc[Value;...;Valuem - Set Graphics Mode (attr, color, val) */
|
/* Esc[Value;...;Valuem - Set Graphics Mode (attr, color, val) */
|
||||||
#define __set_gm(a,c,v) \
|
#define __set_gm(a,c,v) \
|
||||||
@@ -94,12 +96,18 @@ static inline void initscr(int *row, int *col)
|
|||||||
struct termios tc, saved;
|
struct termios tc, saved;
|
||||||
struct pollfd fd = { STDIN_FILENO, POLLIN, 0 };
|
struct pollfd fd = { STDIN_FILENO, POLLIN, 0 };
|
||||||
|
|
||||||
|
if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO)) {
|
||||||
|
*row = 24;
|
||||||
|
*col = 80;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Disable echo to terminal while probing */
|
/* Disable echo to terminal while probing */
|
||||||
tcgetattr(STDERR_FILENO, &tc);
|
tcgetattr(STDOUT_FILENO, &tc);
|
||||||
saved = tc;
|
saved = tc;
|
||||||
tc.c_cflag |= (CLOCAL | CREAD);
|
tc.c_cflag |= (CLOCAL | CREAD);
|
||||||
tc.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
|
tc.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
|
||||||
tcsetattr(STDERR_FILENO, TCSANOW, &tc);
|
tcsetattr(STDOUT_FILENO, TCSANOW, &tc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Save cursor pos+attr
|
* Save cursor pos+attr
|
||||||
@@ -107,7 +115,8 @@ static inline void initscr(int *row, int *col)
|
|||||||
* Set cursor at the far bottom,right pos
|
* Set cursor at the far bottom,right pos
|
||||||
* Query term for resulting pos
|
* Query term for resulting pos
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, "\e7" "\e[r" "\e[999;999H" "\e[6n");
|
fprintf(stdout, "\e7" "\e[r" "\e[999;999H" "\e[6n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wait here for terminal to echo back \e[row,lineR ...
|
* Wait here for terminal to echo back \e[row,lineR ...
|
||||||
@@ -120,10 +129,11 @@ static inline void initscr(int *row, int *col)
|
|||||||
/*
|
/*
|
||||||
* Restore above saved cursor pos+attr
|
* Restore above saved cursor pos+attr
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, "\e8");
|
fprintf(stdout, "\e8");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
/* Restore terminal */
|
/* Restore terminal */
|
||||||
tcsetattr(STDERR_FILENO, TCSANOW, &saved);
|
tcsetattr(STDOUT_FILENO, TCSANOW, &saved);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
#else
|
#else
|
||||||
|
|||||||
Vendored
+12
@@ -1,3 +1,15 @@
|
|||||||
|
libite (1.9.3-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release, v1.9.3, fixes to conio.h, initscr() and tree().
|
||||||
|
|
||||||
|
-- Joachim Nilsson <troglobit@gmail.com> Tue, 24 Oct 2017 08:49:54 +0200
|
||||||
|
|
||||||
|
libite (1.9.2-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream reelase, v1.9.2, see upstream ChangeLog for details.
|
||||||
|
|
||||||
|
-- Joachim Nilsson <troglobit@gmail.com> Tue, 15 Aug 2017 08:15:14 +0200
|
||||||
|
|
||||||
libite (1.9.1-1) unstable; urgency=low
|
libite (1.9.1-1) unstable; urgency=low
|
||||||
|
|
||||||
* New upstream reelase, v1.9.1.
|
* New upstream reelase, v1.9.1.
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ int main(void)
|
|||||||
struct { char *path; int fail; } arr[] = {
|
struct { char *path; int fail; } arr[] = {
|
||||||
{ "/etc/passwd", -1 },
|
{ "/etc/passwd", -1 },
|
||||||
{ "/dev", 0 },
|
{ "/dev", 0 },
|
||||||
{ "/sbin", 0 },
|
{ "/usr/sbin", 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0; i < NELEMS(arr); i++) {
|
for (i = 0; i < NELEMS(arr); i++) {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ static int descend(char *path, int show_perms, char *pfx)
|
|||||||
if (n) {
|
if (n) {
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
char t = ' ', p[14] = "", s[256] = "";
|
char t = ' ', p[14] = "", s[256] = "";
|
||||||
char buf[256];
|
char buf[512];
|
||||||
char dir[80];
|
char dir[80];
|
||||||
|
|
||||||
if (i + 1 == n) {
|
if (i + 1 == n) {
|
||||||
|
|||||||
Reference in new issue
Block a user