diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-10-01 15:48:41 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-10-01 15:48:41 +0200 |
commit | c09acdcf0b9f2a1b9b224025dc909a14e7aad717 (patch) | |
tree | 00adb557894886f316e0c1385bb3e442682432d0 /l10ntools | |
parent | 2844b43a3900595a6a8a759fbdd7d8d485078e79 (diff) |
Fixed some encoding issues in tools used by localize
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/scripts/localize.pl | 2 | ||||
-rw-r--r-- | l10ntools/source/directory.cxx | 23 |
2 files changed, 11 insertions, 14 deletions
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl index 7a9d8beb6f15..0eb30bd90424 100644 --- a/l10ntools/scripts/localize.pl +++ b/l10ntools/scripts/localize.pl @@ -488,7 +488,7 @@ sub collectfiles{ }else{ $command = $binpath."localize_sl"; } - print $command; + print $command . "\n"; # -e # if ( -x $command ){ if( $command ){ diff --git a/l10ntools/source/directory.cxx b/l10ntools/source/directory.cxx index a36f8bd2361f..c248ec38ca17 100644 --- a/l10ntools/source/directory.cxx +++ b/l10ntools/source/directory.cxx @@ -187,29 +187,26 @@ void Directory::readDirectory( const rtl::OUString& sFullpath ) struct stat statbuf2; struct dirent *dirp; DIR *dir; - //int ret; - //char *ptr; if( sFullpath.getLength() < 1 ) return; - rtl::OString sFullpathext = rtl::OUStringToOString( sFullpath , RTL_TEXTENCODING_UTF8 , sFullpath.getLength() ).getStr(); - //printf("%s\n",sFullpathext.getStr()); + rtl::OString sFullpathext = rtl::OUStringToOString( sFullpath , RTL_TEXTENCODING_UTF8 ); const char* path = sFullpathext.getStr(); // stat - if( stat( path , &statbuf ) < 0 ){ printf("warning: Can not stat %s" , path ); return; }// error } + if( stat( path , &statbuf ) < 0 ){ printf("warning: Can not stat %s" , path ); return; } - if( S_ISDIR(statbuf.st_mode ) == 0 ) { return; }// error } return; // not dir + if( S_ISDIR(statbuf.st_mode ) == 0 ) { return; } - if( (dir = opendir( path ) ) == NULL ) {printf("readerror 2 in %s \n",path); return; } // error } return; // error + if( (dir = opendir( path ) ) == NULL ) {printf("readerror 2 in %s \n",path); return; } dirholder aHolder(dir); - sFullpathext += rtl::OString( "/" ); - const rtl::OString sDot ( "." ) ; const rtl::OString sDDot( ".." ); - if ( chdir( path ) == -1 ) { printf("chdir error in %s \n",path); return; } // error + if ( chdir( path ) == -1 ) { printf("chdir error in %s \n",path); return; } + + sFullpathext += rtl::OString( "/" ); while( ( dirp = readdir( dir ) ) != NULL ) { @@ -225,7 +222,7 @@ void Directory::readDirectory( const rtl::OUString& sFullpath ) // stat new entry if( lstat( sEntity.getStr() , &statbuf2 ) < 0 ) { - printf("error on entry %s\n" , sEntity.getStr() ) ; // error + printf("error on entry %s\n" , sEntity.getStr() ) ; continue; } @@ -261,8 +258,8 @@ void Directory::readDirectory( const rtl::OUString& sFullpath ) } } } - if ( chdir( ".." ) == -1 ) { printf("chdir error in .. \n"); return; } // error - if( aHolder.close() < 0 ) return ; // error + if ( chdir( ".." ) == -1 ) { printf("chdir error in .. \n"); return; } + if( aHolder.close() < 0 ) return ; std::sort( aFileVec.begin() , aFileVec.end() , File::lessFile ); std::sort( aDirVec.begin() , aDirVec.end() , Directory::lessDir ); |