Lines Matching refs:dest

454 static int xglob(o_string *dest, int flags, glob_t *pglob);
463 static int done_word(o_string *dest, struct p_context *ctx);
470 static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, int su…
471 static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch);
475 static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input);
477 static int parse_string(o_string *dest, struct p_context *ctx, const char *src);
479 static int parse_stream(o_string *dest, struct p_context *ctx, struct in_str *input0, int end_trigg…
2047 char *dest; local
2052 dest = malloc(cnt);
2053 if (!dest) return GLOB_NOSPACE;
2063 pglob->gl_pathv[pathc-1]=dest;
2065 for (s=src; s && *s; s++, dest++) {
2067 *dest = *s;
2069 *dest='\0';
2096 static int xglob(o_string *dest, int flags, glob_t *pglob) argument
2102 if (dest->length == 0) {
2103 if (dest->nonnull) {
2105 gr = globhack(dest->data, flags, pglob);
2110 } else if (glob_needed(dest->data)) {
2111 gr = glob(dest->data, flags, NULL, pglob);
2115 gr = globhack(dest->data, flags, pglob);
2119 gr = globhack(dest->data, flags, pglob);
2401 static int reserved_word(o_string *dest, struct p_context *ctx) argument
2406 if (strcmp(dest->data, r->literal) == 0) {
2415 b_reset(dest);
2424 b_reset(dest);
2441 b_reset (dest);
2450 static int done_word(o_string *dest, struct p_context *ctx) argument
2461 debug_printf("done_word: %s %p\n", dest->data, child);
2462 if (dest->length == 0 && !dest->nonnull) {
2476 debug_printf("checking %s for reserved-ness\n",dest->data);
2477 if (reserved_word(dest,ctx)) return ctx->w==RES_SNTX;
2483 for (cnt = 1, s = dest->data; s && *s; s++) {
2505 child->argv_nonnull[argc-1] = dest->nonnull;
2508 for (s = dest->data; s && *s; s++,str++) {
2516 gr = xglob(dest, flags, glob_target);
2520 b_reset(dest);
2533 done_word(dest,ctx);
2698 static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, int su… argument
2720 retcode = parse_stream(dest, ctx, &pipe_str, '\0');
2741 static int parse_group(o_string *dest, struct p_context *ctx, argument
2757 rcode=parse_stream(dest,&sub,input,endch);
2758 done_word(dest,&sub); /* finish off the final word in the subcontext */
2837 static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input) argument
2850 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2854 b_addchr(dest,ch);
2856 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2861 parse_string(dest, ctx, global_argv[i]); /* recursion */
2868 b_adduint(dest,getpid());
2872 if (last_bg_pid > 0) b_adduint(dest, last_bg_pid);
2878 b_adduint(dest,last_return_code);
2881 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2882 b_addchr(dest, '$');
2883 b_addchr(dest, '?');
2884 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2890 b_adduint(dest,global_argc ? global_argc-1 : 0);
2895 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2900 b_addchr(dest,ch);
2906 b_addchr(dest, SPECIAL_VAR_SYMBOL);
2911 process_command_subs(dest, ctx, input, ')');
2916 parse_string(dest, ctx, global_argv[i]);
2917 if (i+1 < global_argc) parse_string(dest, ctx, sep);
2929 b_addqchr(dest,'$',dest->quote);
2941 int parse_string(o_string *dest, struct p_context *ctx, const char *src) argument
2945 return parse_stream(dest, ctx, &foo, '\0');
2950 static int parse_stream(o_string *dest, struct p_context *ctx, argument
2974 dest->quote, ctx->stack == NULL ? '*' : '.');
2976 if (m==0 || ((m==1 || m==2) && dest->quote)) {
2977 b_addqchr(dest, ch, dest->quote);
2980 if (done_word(dest, ctx)) {
2988 if (ch == end_trigger && !dest->quote && ctx->w==RES_NONE) {
3002 if (dest->length == 0 && !dest->quote) {
3005 b_addqchr(dest, ch, dest->quote);
3013 b_addqchr(dest, '\\', dest->quote);
3014 b_addqchr(dest, b_getch(input), dest->quote);
3017 if (handle_dollar(dest, ctx, input)!=0) return 1;
3020 dest->nonnull = 1;
3025 b_addchr(dest,ch);
3033 dest->nonnull = 1;
3034 dest->quote = !dest->quote;
3038 process_command_subs(dest, ctx, input, '`');
3041 redir_fd = redirect_opt_num(dest);
3042 done_word(dest, ctx);
3054 redir_fd = redirect_opt_num(dest);
3055 done_word(dest, ctx);
3071 done_word(dest, ctx);
3075 done_word(dest, ctx);
3089 done_word(dest, ctx);
3108 if (parse_group(dest, ctx, input, ch)!=0) return 1;
3117 dest->nonnull = 1;
3123 b_addchr(dest, ch);