@sasjs/core 7.0.1 → 7.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "@nogoo9/gitleaks": "8.30.1-post.2"
45
45
  },
46
- "version": "7.0.1"
46
+ "version": "7.0.2"
47
47
  }
@@ -350,7 +350,8 @@ filename &webref "&webrefpath";
350
350
  )
351
351
  %if "&outstatus" ne "0" %then %do;
352
352
  data &outstatus;
353
- length state $20 uri $256 errmsg $256 platform $10;
353
+ length state $20 uri $256 errmsg $32767 platform $10;
354
+ length line $32767;
354
355
  retain state 'completed' uri '' errmsg '' platform 'SASJS' abortseen 0;
355
356
  infile &respref end=eof lrecl=32767;
356
357
  /* scan the whole response - the abort block is not always on the first
@@ -363,10 +364,15 @@ filename &webref "&webrefpath";
363
364
  abortseen=1;
364
365
  end;
365
366
  if abortseen=1 and errmsg='' and index(_infile_,'"MSG"')>0 then do;
366
- /* prxchange returns its input untouched when nothing matches, which
367
- * would put the whole line in errmsg */
368
- if prxmatch('/"MSG" *: *"([^"]*)"/',_infile_) then
369
- errmsg=prxchange('s/.*"MSG" *: *"([^"]*)".*/$1/',-1,_infile_);
367
+ /* a quote inside the message arrives escaped, and the capture below
368
+ * used to stop at it, returning the part before the first \" and
369
+ * dropping the rest. The escaped pairs are unescaped first, so the
370
+ * value is captured whole: the match is greedy and runs to the
371
+ * closing quote of the value rather than to the first quote after
372
+ * the field name. */
373
+ line=tranwrd(_infile_,'\"','"');
374
+ if prxmatch('/"MSG" *: *"(.*)"/',line) then
375
+ errmsg=prxchange('s/.*"MSG" *: *"(.*)".*/$1/',-1,line);
370
376
  end;
371
377
  end;
372
378
  /* one row, whatever the response contained */