diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-01-10 12:30:37 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-01-10 12:30:37 +0200 |
commit | 1daf400c55ab311c43f1cfa0a253955d81c0c2e7 (patch) | |
tree | 8951b5772f56ee5086fce670261777356858b606 /vms/vms_args.c | |
parent | 54684e9a410c64bcde42c39e02832d586ffd1074 (diff) | |
parent | 664868f72b741ba448398d609e18a4cbb1ca20be (diff) | |
download | egawk-1daf400c55ab311c43f1cfa0a253955d81c0c2e7.tar.gz egawk-1daf400c55ab311c43f1cfa0a253955d81c0c2e7.tar.bz2 egawk-1daf400c55ab311c43f1cfa0a253955d81c0c2e7.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'vms/vms_args.c')
-rw-r--r-- | vms/vms_args.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/vms/vms_args.c b/vms/vms_args.c index 0a296105..12165131 100644 --- a/vms/vms_args.c +++ b/vms/vms_args.c @@ -1,7 +1,7 @@ /* vms_args.c -- command line parsing, to emulate shell i/o redirection. [ Escape sequence parsing now suppressed. ] - Copyright (C) 1991-1996, 1997, 2011 the Free Software Foundation, Inc. + Copyright (C) 1991-1996, 1997, 2011, 2014 the Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -106,10 +106,26 @@ vms_arg_fixup( int *pargc, char ***pargv ) char **argv = *pargv; int i, argc = *pargc; int err_to_out_redirect = 0, out_to_err_redirect = 0; + char * shell; + int using_shell; /* make sure AWK_LIBRARY has a value */ if (!getenv("AWK_LIBRARY")) vms_define("AWK_LIBRARY", "SYS$LIBRARY:"); + + /* Check if running under a shell instead of DCL */ + using_shell = 1; + shell = getenv("SHELL"); + if (shell != NULL) { + if (strcmp(shell, "DCL") == 0) { + using_shell = 0; + } + } else { + using_shell = 0; + } + if (using_shell) { + return; + } #ifdef CHECK_DECSHELL /* don't define this if linking with DECC$SHR */ if (shell$is_shell()) return; /* don't do anything if we're running DEC/Shell */ @@ -325,12 +341,12 @@ vms_expand_wildcards( const char *prospective_filespec ) */ len = -1; /* overload 'len' with flag value */ context = NULL; /* init */ - while (vmswork(lib$find_file(&spec, &result, &context))) { + while (vmswork(LIB$FIND_FILE(&spec, &result, &context))) { for (len = sizeof(res_buf)-1; len > 0 && res_buf[len-1] == ' '; len--) ; res_buf[len] = '\0'; /* terminate after discarding trailing blanks */ v_add_arg(v_argc++, strdup(res_buf)); /* store result */ } - (void)lib$find_file_end(&context); + (void)LIB$FIND_FILE_END(&context); if (len >= 0) /* (still -1 => never entered loop) */ --v_argc; /* undo final post-increment */ return; @@ -395,7 +411,7 @@ vms_define( const char *log_name, const char *trans_val ) log_dsc.len = len; itemlist[0].buffer = (char *)trans_val; itemlist[0].len = strlen(trans_val); - return sys$crelnm(&attr, &lnmtable, &log_dsc, &acmode, itemlist); + return SYS$CRELNM(&attr, &lnmtable, &log_dsc, &acmode, itemlist); } /* t_strstr -- strstr() substitute; search 'str' for 'sub' */ |