extras/ignorecase.c
changeset 1631 1aec60db9326
parent 1556 1399fe45e5b9
child 1638 1cbecbcf537e
equal deleted inserted replaced
1630:5123a32160af 1631:1aec60db9326
    99     char buf[128];
    99     char buf[128];
   100     PHYSFS_File *f;
   100     PHYSFS_File *f;
   101 
   101 
   102     if (!PHYSFS_init(argv[0]))
   102     if (!PHYSFS_init(argv[0]))
   103     {
   103     {
   104         fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getLastError());
   104         fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
   105         return 1;
   105         return 1;
   106     } /* if */
   106     } /* if */
   107 
   107 
   108     if (!PHYSFS_addToSearchPath(".", 1))
   108     if (!PHYSFS_addToSearchPath(".", 1))
   109     {
   109     {
   110         fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getLastError());
   110         fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
   111         PHYSFS_deinit();
   111         PHYSFS_deinit();
   112         return 1;
   112         return 1;
   113     } /* if */
   113     } /* if */
   114 
   114 
   115     if (!PHYSFS_setWriteDir("."))
   115     if (!PHYSFS_setWriteDir("."))
   116     {
   116     {
   117         fprintf(stderr, "PHYSFS_setWriteDir(): %s\n", PHYSFS_getLastError());
   117         fprintf(stderr, "PHYSFS_setWriteDir(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
   118         PHYSFS_deinit();
   118         PHYSFS_deinit();
   119         return 1;
   119         return 1;
   120     } /* if */
   120     } /* if */
   121 
   121 
   122     if (!PHYSFS_mkdir("/a/b/c"))
   122     if (!PHYSFS_mkdir("/a/b/c"))
   123     {
   123     {
   124         fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getLastError());
   124         fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
   125         PHYSFS_deinit();
   125         PHYSFS_deinit();
   126         return 1;
   126         return 1;
   127     } /* if */
   127     } /* if */
   128 
   128 
   129     if (!PHYSFS_mkdir("/a/b/C"))
   129     if (!PHYSFS_mkdir("/a/b/C"))
   130     {
   130     {
   131         fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getLastError());
   131         fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
   132         PHYSFS_deinit();
   132         PHYSFS_deinit();
   133         return 1;
   133         return 1;
   134     } /* if */
   134     } /* if */
   135 
   135 
   136     f = PHYSFS_openWrite("/a/b/c/x.txt");
   136     f = PHYSFS_openWrite("/a/b/c/x.txt");
   137     PHYSFS_close(f);
   137     PHYSFS_close(f);
   138     if (f == NULL)
   138     if (f == NULL)
   139     {
   139     {
   140         fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getLastError());
   140         fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
   141         PHYSFS_deinit();
   141         PHYSFS_deinit();
   142         return 1;
   142         return 1;
   143     } /* if */
   143     } /* if */
   144 
   144 
   145     f = PHYSFS_openWrite("/a/b/C/X.txt");
   145     f = PHYSFS_openWrite("/a/b/C/X.txt");
   146     PHYSFS_close(f);
   146     PHYSFS_close(f);
   147     if (f == NULL)
   147     if (f == NULL)
   148     {
   148     {
   149         fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getLastError());
   149         fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
   150         PHYSFS_deinit();
   150         PHYSFS_deinit();
   151         return 1;
   151         return 1;
   152     } /* if */
   152     } /* if */
   153 
   153 
   154     strcpy(buf, "/a/b/c/x.txt");
   154     strcpy(buf, "/a/b/c/x.txt");