Displaying 16 results from an estimated 16 matches for "c_isprint".
2012 Mar 11
1
[PATCH] Coalesce printable characters in debug and trace messages (RHBZ#802109).
...#802109: Because stderr is usually not buffered, avoid
+ * single 'putc' calls (which translate to a 1 byte write), and
+ * try to send longest possible strings in single fwrite calls
+ * (thanks to Jim Meyering for the basic approach).
*/
+#define NO_ESCAPING(c) \
+ (c_isprint ((c)) || (from_appliance && ((c) == '\n' || (c) == '\r')))
+
for (i = 0; i < buf_len; ++i) {
- c = buf[i];
- if (c_isprint (c) || (from_appliance && (c == '\n' || c == '\r')))
- putc (c, stderr);
- else {
- switch...
2009 Sep 24
1
enabling more syntax-checks
..."c-ctype.h"
#include "ignore-value.h"
#include "daemon.h"
@@ -96,7 +96,7 @@ main_loop (int _sock)
printf (" ");
printf ("|");
for (j = i; j < MIN (i+16, len); ++j)
- if (isprint (buf[j]))
+ if (c_isprint (buf[j]))
printf ("%c", buf[j]);
else
printf (".");
diff --git a/examples/Makefile.am b/examples/Makefile.am
index fb3d656..adbb934 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -7,7 +7,9 @@ hello_CFLAGS = -I$(top_srcdir)/sr...
2010 Apr 03
1
hivex: Exported foreign symbols in libhivex.so.0.0.0
...s page may help with this:
http://gcc.gnu.org/wiki/Visibility
Symbols:
asnprintf at Base 1.2.1
c_isalnum at Base 1.2.1
c_isalpha at Base 1.2.1
c_isascii at Base 1.2.1
c_isblank at Base 1.2.1
c_iscntrl at Base 1.2.1
c_isdigit at Base 1.2.1
c_isgraph at Base 1.2.1
c_islower at Base 1.2.1
c_isprint at Base 1.2.1
c_ispunct at Base 1.2.1
c_isspace at Base 1.2.1
c_isupper at Base 1.2.1
c_isxdigit at Base 1.2.1
c_tolower at Base 1.2.1
c_toupper at Base 1.2.1
exit_failure at Base 1.2.1
full_read at Base 1.2.1
full_write at Base 1.2.1
printf_fetchargs at Base 1.2.1
printf_parse at Base 1...
2016 Feb 24
3
[PATCH 1/3] src: generate code for printing contents of structs
...pr " fprintf (dest, \"%%s\", linesep);\n"
+ | name, FBuffer ->
+ pr " fprintf (dest, \"%%s%s: \", indent);\n" name;
+ pr " for (i = 0; i < %s->%s_len; ++i)\n" typ name;
+ pr " if (c_isprint (%s->%s[i]))\n" typ name;
+ pr " fprintf (dest, \"%%c\", %s->%s[i]);\n" typ name;
+ pr " else\n";
+ pr " fprintf (dest, \"\\\\x%%02x\", (unsigned) %s->%s[i]);\n"
+ typ...
2014 Oct 31
0
[PATCH 1/3] fish: rl.{c, h} - escaping functions for readline
...': *(n++) = '\\'; *n = ' '; break;
+
+ default:
+ // Hexadecimal escape unprintable character. This violates identity
+ // after composition of bsquote_filename after debsquote_filename
+ // (i.e. can escape some characters differently).
+ if (!c_isprint(*p)) {
+ n += sprintf(n, "\\x%x", (int) (*p & 0xff)) - 1;
+ } else {
+ *n = *p;
+ }
+ break;
+ error:
+ fprintf (stderr, ("%s: invalid escape sequence in string (starting at offset %d)\n"),
+ program_name, (i...
2014 Oct 31
6
[PATCH 0/3] WIP readline escaping functions
From: Maros Zatko <hacxman@gmail.com>
Auxiliary functions for readline to support space character escaping
in filenames in future.
Escaping function is taken from fish.c (used to be parse_quoted_string)
plus its un-escaping counterpart. There are a few tests for both.
Maros Zatko (3):
fish: rl.{c,h} - escaping functions for readline
fish: basic tests for readline escaping
autotools:
2014 Nov 07
3
[PATCH 0/3] v2 readline escaping functions
From: Maros Zatko <mzatko@redhat.com>
Helper functions for future support of backslash escaped spaces in filenames.
There are a few tests too. Changed according to review remarks.
Maros Zatko (3):
fish: rl.{c, h} - escaping functions for readline
fish: basic tests for readline escaping
autotools: add fish/test
Makefile.am | 1 +
configure.ac | 1 +
2014 Nov 13
4
[PATCH 0/4 v3] readline escaping functions
Helper functions for future support of backslash escaped spaces in filenames.
There are a few tests too. Changed according to review remarks and fixed few
other mistakes.
Maros Zatko (4):
fish: copy parse_quoted_string and hexdigit from fish.h to rl.c
fish: rl.{c,h} - escaping functions for readline
fish: basic tests for readline escaping
autotools: add fish/test
Makefile.am
2011 Sep 17
3
[PATCH 1/1] hivexml: Base64-encode non-printable data
Some of the data in names and string values were being unsafely printed,
causing some types of XML processors to fail (e.g. Python's Expat).
This patch checks for printability of each character and outputs base64
with an encoding attribute for unsafe data.
---
xml/hivexml.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 64 insertions(+), 11 deletions(-)
2015 Jul 02
0
[PATCH] Fix various -Wformat problems.
...yp typ;
pr "{\n";
if needs_i then (
- pr " unsigned int i;\n";
+ pr " size_t i;\n";
pr "\n"
);
List.iter (
@@ -288,7 +288,8 @@ Guestfish will prompt for these separately."
pr " if (c_isprint (%s->%s[i]))\n" typ name;
pr " printf (\"%%c\", %s->%s[i]);\n" typ name;
pr " else\n";
- pr " printf (\"\\\\x%%02x\", %s->%s[i]);\n" typ name;
+ pr " printf (\"...
2015 Jul 02
0
[PATCH v2] Fix various -Wformat problems.
...yp typ;
pr "{\n";
if needs_i then (
- pr " unsigned int i;\n";
+ pr " size_t i;\n";
pr "\n"
);
List.iter (
@@ -288,7 +288,8 @@ Guestfish will prompt for these separately."
pr " if (c_isprint (%s->%s[i]))\n" typ name;
pr " printf (\"%%c\", %s->%s[i]);\n" typ name;
pr " else\n";
- pr " printf (\"\\\\x%%02x\", %s->%s[i]);\n" typ name;
+ pr " printf (\"...
2013 Mar 07
3
[PATCH 0/3] protocol: Abstract out socket operations.
I've been taking a long hard look at the protocol layer. It has
evolved over a long time without any particular direction, and the
result is, to say the least, not very organized.
These patches take a first step at cleaning up the mess by abstracting
out socket operations from the rest of the code. The purpose of this
is to allow us to slot in a different connection layer under the
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...size_t buf_len)
{
size_t i, count = 0;
@@ -167,8 +167,8 @@ guestfs_int_call_callbacks_message (guestfs_h *g, uint64_t event,
* try to send longest possible strings in single fwrite calls
* (thanks to Jim Meyering for the basic approach).
*/
-#define NO_ESCAPING(c) \
- (c_isprint ((c)) || (from_appliance && ((c) == '\n' || (c) == '\r')))
+#define NO_ESCAPING(c) \
+ (c_isprint ((c)) || (from_appliance && ((c) == '\n' || (c) == '\r')))
for (i = 0; i < buf_len; ++i) {
if (NO_ESCAPING (buf[i])) {
@@ -204,...
2015 Oct 05
3
[PATCH 1/2] Change 'fprintf (stdout,...)' -> printf.
Result of earlier copy and paste.
---
align/scan.c | 35 ++++++++++---------
cat/cat.c | 39 +++++++++++----------
cat/filesystems.c | 69 +++++++++++++++++++-------------------
cat/log.c | 35 ++++++++++---------
cat/ls.c | 61 +++++++++++++++++----------------
df/main.c | 43 ++++++++++++------------
diff/diff.c | 67
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...rintf");
- exit (EXIT_FAILURE);
- }
+ if (printf ("-> %s", link) < 0)
+ error (EXIT_FAILURE, errno, "printf");
}
}
@@ -949,15 +924,11 @@ output_binary (const char *s, size_t len)
print_no_quoting:
for (i = 0; i < len; ++i) {
if (c_isprint (s[i])) {
- if (putchar (s[i]) == EOF) {
- perror ("putchar");
- exit (EXIT_FAILURE);
- }
+ if (putchar (s[i]) == EOF)
+ error (EXIT_FAILURE, errno, "putchar");
} else {
- if (printf ("\\x%02x", (unsigned ch...
2013 Aug 24
67
[PATCH 00/67] Proposed patches for libguestfs 1.22.6.
In the kernel and qemu communities it is routine for patches that will
be backported to stable branches to be posted for review. I'm
proposing we do the same for libguestfs stable branches.
All of the attached have been tested with 'make check-release'.
Rich.