~ubuntu-branches/ubuntu/edgy/mcpp/edgy

« back to all changes in this revision

Viewing changes to tool/rm_once.c

  • Committer: Bazaar Package Importer
  • Author(s): NIIBE Yutaka
  • Date: 2005-04-16 15:58:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050416155816-q9a9ipx724qvf3le
Tags: 2.5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * rm_once.c    2002/08      kmatsui
3
 
 *  to remove '#pragma __once' line from the top of header files
 
2
 * rm_once.c    2002/08, 2004/11    kmatsui
 
3
 *  to remove '#pragma __once' and '#pragma once' line from the top of
 
4
 *  header files
4
5
 */
5
6
 
6
7
#include    "stdio.h"
10
11
main( int argc, char ** argv)
11
12
{
12
13
    char    buf[ BUFSIZ];
13
 
    char    *once = "\n#pragma __once\n\n";
 
14
    char    *__once = "\n#pragma __once\n\n";
 
15
    char    *once = "\n#pragma once\n\n";
14
16
    char    *tmp = "tmp.once";
15
17
    char    *fname;
16
18
    FILE    *fp_in, *fp_out;
21
23
        if ((fp_in = fopen( *argv, "r")) != NULL) {
22
24
            for (cp = buf, i = 0; i < 3; i++, cp += strlen( cp))
23
25
                fgets( cp, BUFSIZ, fp_in);
24
 
            if (strcmp( buf, once) != 0) {
 
26
            if (strcmp( buf, once) != 0 || strcmp( buf, __once) != 0) {
25
27
                fprintf( stderr, "Skipped %s\n", *argv);
26
28
                fclose( fp_in);
27
29
                continue;