Fixed scan continuation line not being set for displayTerm being ste
[yaz-moved-to-github.git] / client / client.c
index 23e9af2..c158b00 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: client.c,v 1.348 2007-07-13 09:28:43 adam Exp $
+ * $Id: client.c,v 1.350 2007-08-21 13:19:44 adam Exp $
  */
 /** \file client.c
  *  \brief yaz-client program
@@ -1915,6 +1915,20 @@ void process_ESResponse(Z_ExtendedServicesResponse *res)
                 }
             }
         }
+        if (ext->which == Z_External_itemOrder)
+        {
+            Z_IOTaskPackage *otp = ext->u.itemOrder->u.taskPackage;
+            if (otp && otp->targetPart && otp->targetPart->itemRequest)
+            {
+                Z_External *ext = otp->targetPart->itemRequest;
+                if (ext->which == Z_External_octet)
+                {
+                    Odr_oct *doc = ext->u.octet_aligned;
+                    printf("Got itemRequest doc %.*s\n",
+                           doc->len, doc->buf);
+                }
+            }
+        }
     }
     if (res->taskPackage && res->taskPackage->which == Z_External_octet)
     {
@@ -3018,13 +3032,13 @@ void display_term(Z_TermInfo *t)
     if (t->displayTerm)
         printf("%s", t->displayTerm);
     else if (t->term->which == Z_Term_general)
-    {
         printf("%.*s", t->term->u.general->len, t->term->u.general->buf);
-        sprintf(last_scan_line, "%.*s", t->term->u.general->len,
-            t->term->u.general->buf);
-    }
     else
         printf("Term (not general)");
+    if (t->term->which == Z_Term_general)
+        sprintf(last_scan_line, "%.*s", t->term->u.general->len,
+            t->term->u.general->buf);
+
     if (t->globalOccurrences)
         printf (" (%d)\n", *t->globalOccurrences);
     else