~ubuntu-branches/ubuntu/wily/geany/wily

« back to all changes in this revision

Viewing changes to tagmanager/strlist.c

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2011-12-10 07:43:26 UTC
  • mfrom: (3.3.7 sid)
  • Revision ID: package-import@ubuntu.com-20111210074326-s8yqbew5i20h33tf
Tags: 0.21-1ubuntu1
* Merge from Debian Unstable, remaining changes:
  - debian/patches/20_use_evince_viewer.patch:
     + use evince as viewer for pdf and dvi files
  - debian/patches/20_use_x_terminal_emulator.patch:
     + use x-terminal-emulator as terminal
  - debian/control
     + Add breaks on geany-plugins-common << 0.20
* Also fixes bugs:
  - Filter for MATLAB/Octave files filters everythign (LP: 885505)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
*   $Id: strlist.c 1715 2007-07-17 12:37:48Z eht16 $
 
2
*   $Id: strlist.c 5555 2011-03-05 22:40:50Z colombanw $
3
3
*
4
4
*   Copyright (c) 1999-2002, Darren Hiebert
5
5
*
92
92
extern stringList* stringListNewFromFile (const char* const fileName)
93
93
{
94
94
        stringList* result = NULL;
95
 
        FILE* const fp = g_fopen (fileName, "r");
96
 
        if (fp != NULL)
 
95
        MIO* const mio = mio_new_file_full (fileName, "r", g_fopen, fclose);
 
96
        if (mio != NULL)
97
97
        {
98
98
                result = stringListNew ();
99
 
                while (! feof (fp))
 
99
                while (! mio_eof (mio))
100
100
                {
101
101
                        vString* const str = vStringNew ();
102
 
                        readLine (str, fp);
 
102
                        readLine (str, mio);
103
103
                        vStringStripTrailing (str);
104
104
                        if (vStringLength (str) > 0)
105
105
                                stringListAdd (result, str);
106
106
                        else
107
107
                                vStringDelete (str);
108
108
                }
 
109
                mio_free (mio);
109
110
        }
110
111
        return result;
111
112
}