View | Details | Raw Unified | Return to bug 16527 | Differences between
and this patch

Collapse All | Expand All

(-)str.default.2.R (-3 / +1 lines)
Lines 445-451 Link Here
445
	    ## For long strings, be careful not use encodeString(.) on the full length
445
	    ## For long strings, be careful not use encodeString(.) on the full length
446
### [[ FIXME? -- currently too complicated? ]]
446
### [[ FIXME? -- currently too complicated? ]]
447
	    if(missing(vec.len)) {
447
	    if(missing(vec.len)) {
448
		encObj <- character(le)
449
		##                            '5*nest...' is fudge factor
448
		##                            '5*nest...' is fudge factor
450
		rhs <- as.integer(width - (4 + 5*nest.lev + nchar(str1, type="w")))
449
		rhs <- as.integer(width - (4 + 5*nest.lev + nchar(str1, type="w")))
451
		subLen <- pmax.int(subLen, as.integer(rhs) - 5L * seq_len(le))
450
		subLen <- pmax.int(subLen, as.integer(rhs) - 5L * seq_len(le))
Lines 464-470 Link Here
464
		ncEnc <- pmax.int(2, ncEnc)
463
		ncEnc <- pmax.int(2, ncEnc)
465
		v.len <- max(1, sum(cumsum(3 + if(le > 0) ncEnc else 0) < rhs))
464
		v.len <- max(1, sum(cumsum(3 + if(le > 0) ncEnc else 0) < rhs))
466
		ile <- min(le, v.len)
465
		ile <- min(le, v.len)
467
		encObj <- encObj[seq_len(ile)]
468
	    } else {
466
	    } else {
469
		v.len <- round(v.len)
467
		v.len <- round(v.len)
470
		ile <- min(le, v.len)
468
		ile <- min(le, v.len)
Lines 482-488 Link Here
482
		}
480
		}
483
	    }
481
	    }
484
	    if(ile >= 1) ## truncate if LONG char:
482
	    if(ile >= 1) ## truncate if LONG char:
485
                object <- maybe_truncate(encObj) # MM: or?? maybe_truncate(encObj[seq_len(ile)])
483
		object <- maybe_truncate(encObj[seq_len(ile)])
486
### end of patch ... 1907 -----------------------------------------------------
484
### end of patch ... 1907 -----------------------------------------------------
487
485
488
					#O: encodeString(object, quote= '"', na.encode= FALSE)
486
					#O: encodeString(object, quote= '"', na.encode= FALSE)

Return to bug 16527