All pastes #298174 Raw Edit

Anonymous

public text v1 · immutable
#298174 ·published 2006-12-31 18:00 UTC
rendered paste body
for (p = s; *p != '\0'; p++) {
		if (escape) {
			escape = FALSE;
			g_string_append_c (gs, *p);
		} else if (*p == '\\') {
			if ( ! single_quot)
				escape = TRUE;
			g_string_append_c (gs, *p);
		} else if (*p == '\'') {
			g_string_append_c (gs, *p);
			if ( ! single_quot && ! double_quot) {
				single_quot = TRUE;
			} else if (single_quot) {
				single_quot = FALSE;
			}
		} else if (*p == '"') {
			g_string_append_c (gs, *p);
			if ( ! single_quot && ! double_quot) {
				double_quot = TRUE;
			} else if (double_quot) {
				double_quot = FALSE;
			}
      /*
		} else if (*p == '%') {
			if (do_percent_subst (item, p, gs,
					      single_quot, double_quot,
					      args, arg_ptr,
					      added_status)) {
				p++;
			}
      */
		} else {
			g_string_append_c (gs, *p);
		}
	}