Skip to content

Commit

Permalink
[#191] Fix $VIEW("GVFILE") to return with @ syntax if specified (prio…
Browse files Browse the repository at this point in the history
…r commit removed the @ if specified)
  • Loading branch information
nars1 committed Oct 19, 2018
1 parent d2d3557 commit cb0757a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions sr_unix/gvcst_init_sysops.c
Expand Up @@ -437,13 +437,12 @@ gd_region *dbfilopn(gd_region *reg)
int status;
boolean_t raw;
boolean_t open_read_only;
int stat_res, rc, save_errno;
int stat_res, rc, save_errno, len;
sgmnt_addrs *csa;
sgmnt_data tsdbuff;
sgmnt_data_ptr_t tsd;
file_control *fc;
unsigned char cstatus;
char *ptr;
boolean_t ftok_counter_halted;
ZOS_ONLY(int realfiletag;)
DCL_THREADGBL_ACCESS;
Expand Down Expand Up @@ -495,11 +494,11 @@ gd_region *dbfilopn(gd_region *reg)
* In case no remote nodename is specified, pblk.l_node is uninitialized and pblk.buffer should be used.
* So in case a remote nodename is specified, use pblk.l_node and use pblk.buffer otherwise.
*/
ptr = !(pblk.fnb & F_HAS_NODE) ? pblk.buffer : pblk.l_node;
memcpy(seg->fname, ptr, pblk.b_esl);
ptr[pblk.b_esl] = 0;
seg->fname[pblk.b_esl] = 0;
seg->fname_len = pblk.b_esl;
len = ('@' == *pblk.buffer) ? pblk.b_esl + 1 : pblk.b_esl;
memcpy(seg->fname, pblk.buffer, pblk.b_esl);
pblk.buffer[len] = 0;
seg->fname[len] = 0;
seg->fname_len = len;
if (pblk.fnb & F_HAS_NODE)
{ /* Remote node specification given */
assert(pblk.b_node && pblk.l_node[pblk.b_node - 1] == ':');
Expand Down

0 comments on commit cb0757a

Please sign in to comment.