ex_range_without_command(exarg_T *eap)
{
    char *errormsg = NULL;

    if ((*eap->cmd == '|' || (exmode_active && eap->line1 != eap->line2))
#ifdef FEAT_EVAL
	    && !in_vim9script()
#endif
       )
    {
	eap->cmdidx = CMD_print;
	eap->argt = EX_RANGE+EX_COUNT+EX_TRLBAR;
	if ((errormsg = invalid_range(eap)) == NULL)
	{
	    correct_range(eap);
	    ex_print(eap);
	}
    }
    else if (eap->addr_count != 0)
    {
	if (eap->line2 > curbuf->b_ml.ml_line_count)
	{
	    // With '-' in 'cpoptions' a line number past the file is an
	    // error, otherwise put it at the end of the file.
	    if (vim_strchr(p_cpo, CPO_MINUS) != NULL)
		eap->line2 = -1;
	    else
		eap->line2 = curbuf->b_ml.ml_line_count;
	}

	if (eap->line2 < 0)
	    errormsg = _(e_invalid_range);
	else
	{
	    if (eap->line2 == 0)
		curwin->w_cursor.lnum = 1;
	    else
		curwin->w_cursor.lnum = eap->line2;
	    beginline(BL_SOL | BL_FIX);
	}
    }
    return errormsg;
}
ex_range_without_command(exarg_T *eap)
{
    char *errormsg = NULL;

    if ((*eap->cmd == '|' || (exmode_active && eap->line1 != eap->line2))
#ifdef FEAT_EVAL
	    && !in_vim9script()
#endif
       )
    {
	eap->cmdidx = CMD_print;
	eap->argt = EX_RANGE+EX_COUNT+EX_TRLBAR;
	if ((errormsg = invalid_range(eap)) == NULL)
	{
	    correct_range(eap);
	    ex_print(eap);
	}
    }
    else if (eap->addr_count != 0)
    {
	if (eap->line2 > curbuf->b_ml.ml_line_count)
	{
	     
	     
	    if (vim_strchr(p_cpo, CPO_MINUS) != NULL)
		eap->line2 = -1;
	    else
		eap->line2 = curbuf->b_ml.ml_line_count;
	}

	if (eap->line2 < 0)
	    errormsg = _(e_invalid_range);
	else
	{
	    if (eap->line2 == 0)
		curwin->w_cursor.lnum = 1;
	    else
		curwin->w_cursor.lnum = eap->line2;
	    beginline(BL_SOL | BL_FIX);
	}
    }
    return errormsg;
}