aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_pager.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-08-22 23:58:15 +1000
committerGravatar axel <axel@liljencrantz.se>2006-08-22 23:58:15 +1000
commit480a29594e62cd11c2c19abb42008472fcd9fa10 (patch)
tree5256089a2a3594343052a5937a2d72cc5f432c85 /fish_pager.c
parentdfe3dc142982cf8c7ca0b9041a91d04cc88a714a (diff)
Minor tweaks to previous fish_pager patch to fix two bugs
darcs-hash:20060822135815-ac50b-35d9f643385ec29f9d8f93ca83d01e060de93cc7.gz
Diffstat (limited to 'fish_pager.c')
-rw-r--r--fish_pager.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/fish_pager.c b/fish_pager.c
index 291a16eb..f5a1ce3d 100644
--- a/fish_pager.c
+++ b/fish_pager.c
@@ -990,9 +990,9 @@ void destroy()
void read_array( FILE* file, array_list_t *comp )
{
char buffer[BUFSIZE];
- char c;
+ int c;
int i;
- wchar_t *wcs;
+ wchar_t *wcs, *unescaped;
while( !feof( file ) )
{
@@ -1000,24 +1000,28 @@ void read_array( FILE* file, array_list_t *comp )
while( i < BUFSIZE-1 )
{
c = getc( file );
- if( c == '\n' || c == PAGER_EOT )
+ if( c == EOF )
{
- break;
+ return;
+
+ }
+ if( c == '\n' )
+ {
+ break;
}
buffer[ i++ ] = c;
}
+
buffer[ i ] = '\0';
wcs = str2wcs( buffer );
if( wcs )
- {
- al_push( comp, wcs );
- }
- if( c == PAGER_EOT )
- {
- break;
- }
+ {
+ unescaped = unescape( wcs, 0 );
+ al_push( comp, unescaped );
+ free( wcs );
+ }
}
}
@@ -1042,7 +1046,7 @@ int main( int argc, char **argv )
debug( 3, L"prefix is '%ls'", prefix );
if( argc > 3 )
- {
+ {
for( i=3; i<argc; i++ )
{
wchar_t *wcs = str2wcs( argv[i] );