aboutsummaryrefslogtreecommitdiffstats
path: root/agent/call-scd.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/call-scd.c')
-rw-r--r--agent/call-scd.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/agent/call-scd.c b/agent/call-scd.c
index f61858e5f..8a6c8ba68 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -1,5 +1,6 @@
/* call-scd.c - fork of the scdaemon to do SC operations
- * Copyright (C) 2001, 2002, 2005, 2007, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2005, 2007, 2010,
+ * 2011 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -44,15 +45,6 @@
#define MAX_OPEN_FDS 20
#endif
-/* This Assuan flag is only available since libassuan 2.0.2. Because
- comments lines are comments anyway we can use a replacement which
- might not do anything. assuan_{g,s}et_flag don't return an error
- thus there won't be any ABI problem. */
-#ifndef ASSUAN_CONVEY_COMMENTS
-#define ASSUAN_CONVEY_COMMENTS 4
-#endif
-
-
/* Definition of module local data of the CTRL structure. */
struct scd_local_s
{
@@ -1115,16 +1107,28 @@ pass_status_thru (void *opaque, const char *line)
char keyword[200];
int i;
- for (i=0; *line && !spacep (line) && i < DIM(keyword)-1; line++, i++)
- keyword[i] = *line;
- keyword[i] = 0;
- /* truncate any remaining keyword stuff. */
- for (; *line && !spacep (line); line++)
- ;
- while (spacep (line))
- line++;
+ if (line[0] == '#' && (!line[1] || spacep (line+1)))
+ {
+ /* We are called in convey comments mode. Now, if we see a
+ comment marker as keyword we forward the line verbatim to the
+ the caller. This way the comment lines from scdaemon won't
+ appear as status lines with keyword '#'. */
+ assuan_write_line (ctx, line);
+ }
+ else
+ {
+ for (i=0; *line && !spacep (line) && i < DIM(keyword)-1; line++, i++)
+ keyword[i] = *line;
+ keyword[i] = 0;
- assuan_write_status (ctx, keyword, line);
+ /* Truncate any remaining keyword stuff. */
+ for (; *line && !spacep (line); line++)
+ ;
+ while (spacep (line))
+ line++;
+
+ assuan_write_status (ctx, keyword, line);
+ }
return 0;
}