projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d583c11
)
Marcdump -c tries to make more readable strings
author
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 3 Apr 2013 09:24:44 +0000
(11:24 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 3 Apr 2013 09:24:44 +0000
(11:24 +0200)
For chr values 32 - 126 the charcter is produced verbatim.
util/marcdump.c
patch
|
blob
|
history
diff --git
a/util/marcdump.c
b/util/marcdump.c
index
e0491c4
..
f92204e
100644
(file)
--- a/
util/marcdump.c
+++ b/
util/marcdump.c
@@
-398,7
+398,10
@@
static void dump(const char *fname, const char *from, const char *to,
{
if ((i & 15) == 0)
fprintf(cfile, " \"");
- fprintf(cfile, "\\x%02X", p[i] & 255);
+ if (p[i] < 32 || p[i] > 126)
+ fprintf(cfile, "\" \"\\x%02X\" \"", p[i] & 255);
+ else
+ fputc(p[i], cfile);
if (i < r - 1 && (i & 15) == 15)
fprintf(cfile, "\"\n");