Lines Matching refs:dest

455 static int xglob(o_string *dest, int flags, glob_t *pglob);
464 static int done_word(o_string *dest, struct p_context *ctx);
471 static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, int su…
472 static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch);
476 static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input);
478 static int parse_string(o_string *dest, struct p_context *ctx, const char *src);
480 static int parse_stream(o_string *dest, struct p_context *ctx, struct in_str *input0, int end_trigg…
2048 char *dest; local
2053 dest = malloc(cnt);
2054 if (!dest) return GLOB_NOSPACE;
2064 pglob->gl_pathv[pathc-1]=dest;
2066 for (s=src; s && *s; s++, dest++) {
2068 *dest = *s;
2070 *dest='\0';
2097 static int xglob(o_string *dest, int flags, glob_t *pglob) argument
2103 if (dest->length == 0) {
2104 if (dest->nonnull) {
2106 gr = globhack(dest->data, flags, pglob);
2111 } else if (glob_needed(dest->data)) {
2112 gr = glob(dest->data, flags, NULL, pglob);
2116 gr = globhack(dest->data, flags, pglob);
2120 gr = globhack(dest->data, flags, pglob);
2402 static int reserved_word(o_string *dest, struct p_context *ctx) argument
2407 if (strcmp(dest->data, r->literal) == 0) {
2416 b_reset(dest);
2425 b_reset(dest);
2442 b_reset (dest);
2451 static int done_word(o_string *dest, struct p_context *ctx) argument
2462 debug_printf("done_word: %s %p\n", dest->data, child);
2463 if (dest->length == 0 && !dest->nonnull) {
2477 debug_printf("checking %s for reserved-ness\n",dest->data);
2478 if (reserved_word(dest,ctx)) return ctx->w==RES_SNTX;
2484 for (cnt = 1, s = dest->data; s && *s; s++) {
2506 child->argv_nonnull[argc-1] = dest->nonnull;
2509 for (s = dest->data; s && *s; s++,str++) {
2517 gr = xglob(dest, flags, glob_target);
2521 b_reset(dest);
2534 done_word(dest,ctx);
2699 static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, int su… argument
2721 retcode = parse_stream(dest, ctx, &pipe_str, '\0');
2742 static int parse_group(o_string *dest, struct p_context *ctx, argument
2758 rcode=parse_stream(dest,&sub,input,endch);
2759 done_word(dest,&sub); /* finish off the final word in the subcontext */
2838 static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input) argument
2851 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2855 b_addchr(dest,ch);
2857 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2862 parse_string(dest, ctx, global_argv[i]); /* recursion */
2869 b_adduint(dest,getpid());
2873 if (last_bg_pid > 0) b_adduint(dest, last_bg_pid);
2879 b_adduint(dest,last_return_code);
2882 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2883 b_addchr(dest, '$');
2884 b_addchr(dest, '?');
2885 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2891 b_adduint(dest,global_argc ? global_argc-1 : 0);
2896 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2901 b_addchr(dest,ch);
2907 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2912 process_command_subs(dest, ctx, input, ')');
2917 parse_string(dest, ctx, global_argv[i]);
2918 if (i+1 < global_argc) parse_string(dest, ctx, sep);
2930 b_addqchr(dest,'$',dest->quote);
2942 int parse_string(o_string *dest, struct p_context *ctx, const char *src) argument
2946 return parse_stream(dest, ctx, &foo, '\0');
2951 static int parse_stream(o_string *dest, struct p_context *ctx, argument
2975 dest->quote, ctx->stack == NULL ? '*' : '.');
2977 if (m==0 || ((m==1 || m==2) && dest->quote)) {
2978 b_addqchr(dest, ch, dest->quote);
2981 if (done_word(dest, ctx)) {
2989 if (ch == end_trigger && !dest->quote && ctx->w==RES_NONE) {
3003 if (dest->length == 0 && !dest->quote) {
3006 b_addqchr(dest, ch, dest->quote);
3014 b_addqchr(dest, '\\', dest->quote);
3015 b_addqchr(dest, b_getch(input), dest->quote);
3018 if (handle_dollar(dest, ctx, input)!=0) return 1;
3021 dest->nonnull = 1;
3026 b_addchr(dest,ch);
3034 dest->nonnull = 1;
3035 dest->quote = !dest->quote;
3039 process_command_subs(dest, ctx, input, '`');
3042 redir_fd = redirect_opt_num(dest);
3043 done_word(dest, ctx);
3055 redir_fd = redirect_opt_num(dest);
3056 done_word(dest, ctx);
3072 done_word(dest, ctx);
3076 done_word(dest, ctx);
3090 done_word(dest, ctx);
3109 if (parse_group(dest, ctx, input, ch)!=0) return 1;
3118 dest->nonnull = 1;
3124 b_addchr(dest, ch);