Permalink
Browse files

* Ignore '#' comment ('#' must be the first char) direct.

  That line will not and no need add in the data array.
* close file : in_file


git-svn-id: https://svn.csie.net/chewing/libchewing/branches/win32@676 ac1be623-90ea-0310-9410-ba68b2efa777
  • Loading branch information...
1 parent bfce4f7 commit f4658a0edd947fce5ff3974b852c47ec47511b64 hialan committed Jun 4, 2006
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/tools/sort_dic.c
View
10 src/tools/sort_dic.c
@@ -88,12 +88,6 @@ void DataStripSpace( long index )
for ( i = 0; old[ i ]; i++ ) {
if ( old[ i ] == ' ' && last == ' ' )
continue;
-
- /* 20060604 : pofeng@gmail.com : to add '#' comment in tsi.src */
- if (old[i]=='#'){
- data[ index ].str[ k++ ]='\0';
- return;
- }
data[ index ].str[ k++ ] = old[ i ];
last = old[ i ];
}
@@ -158,6 +152,9 @@ int main( int argc, char *argv[] )
}
while ( fgets( data[ nData ].str, MAXLEN, infile ) ) {
+ // Add '#' comment for tsi.src
+ if( data[ nData ].str[0] == '#')
+ continue;
DataStripSpace( nData );
DataSetNum( nData );
SetNewline2Zero( nData );
@@ -183,6 +180,7 @@ int main( int argc, char *argv[] )
fprintf( treedata, "0\n" );
}
+ fclose( infile );
fclose( ph_index );
fclose( dictfile );
fclose( treedata );

0 comments on commit f4658a0

Please sign in to comment.