From 9cad1a7d433e9624ae0691d236d08093b92d4d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 9 Dec 2018 00:59:46 +0100 Subject: [PATCH] Update TDEL10n module + Use file( READ ) during updating references for resources because file( STRINGS ) has problems with special characters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 0f348d894e09f08c9caf1c363fb48b61efec7e0f) --- modules/TDEL10n.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake index 58a4313..9702553 100644 --- a/modules/TDEL10n.cmake +++ b/modules/TDEL10n.cmake @@ -432,11 +432,13 @@ macro( tde_l10n_create_template ) # update references for resources to original files and line numbers if( _rcs OR _attributes ) - file( STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/extracted-rc.tde_l10n" _extractedRC ) - list( LENGTH _extractedRC _extractedRC_len ) + file( READ "${CMAKE_CURRENT_SOURCE_DIR}/extracted-rc.tde_l10n" _extractedRC ) + string( REGEX REPLACE "[^\n]" "" _extractedRC_len "${_extractedRC}" ) + string( LENGTH "+${_extractedRC_len}" _extractedRC_len ) set( _rcPos 0 ) while( _rcPos LESS ${_extractedRC_len} ) - list( GET _extractedRC ${_rcPos} _rcLine ) + string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _rcLine "${_extractedRC}" ) + string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\2" _extractedRC "${_extractedRC}" ) math( EXPR _rcPos "${_rcPos}+1" ) if( "${_rcLine}" MATCHES "^//i18n: file .* line [0-9]*$" ) string( REGEX REPLACE "^//i18n: file (.*) line ([0-9]*)$" "\\1:\\2" _rcOrig ${_rcLine} )