test/test_physfs.c
changeset 101 bd18e17ad6ad
parent 74 a4a5066fb640
child 108 90f7ad8a0ab5
equal deleted inserted replaced
100:d2f04ab4b412 101:bd18e17ad6ad
   240 } /* cmd_permitsyms */
   240 } /* cmd_permitsyms */
   241 
   241 
   242 
   242 
   243 static int cmd_setsaneconfig(char *args)
   243 static int cmd_setsaneconfig(char *args)
   244 {
   244 {
       
   245     char *org;
   245     char *appName;
   246     char *appName;
   246     char *arcExt;
   247     char *arcExt;
   247     int inclCD;
   248     int inclCD;
   248     int arcsFirst;
   249     int arcsFirst;
   249     char *ptr = args;
   250     char *ptr = args;
   250 
   251 
   251         /* ugly. */
   252         /* ugly. */
   252     appName = ptr;
   253     org = ptr;
       
   254     ptr = strchr(ptr, ' '); *ptr = '\0'; ptr++; appName = ptr;
   253     ptr = strchr(ptr, ' '); *ptr = '\0'; ptr++; arcExt = ptr;
   255     ptr = strchr(ptr, ' '); *ptr = '\0'; ptr++; arcExt = ptr;
   254     ptr = strchr(ptr, ' '); *ptr = '\0'; ptr++; inclCD = atoi(arcExt);
   256     ptr = strchr(ptr, ' '); *ptr = '\0'; ptr++; inclCD = atoi(arcExt);
   255     arcsFirst = atoi(ptr);
   257     arcsFirst = atoi(ptr);
   256 
   258 
   257     if (strcmp(appName, "!") == 0)
       
   258         appName = NULL;
       
   259 
       
   260     if (strcmp(arcExt, "!") == 0)
   259     if (strcmp(arcExt, "!") == 0)
   261         arcExt = NULL;
   260         arcExt = NULL;
   262 
   261 
   263     if (PHYSFS_setSaneConfig(appName, arcExt, inclCD, arcsFirst))
   262     if (PHYSFS_setSaneConfig(org, appName, arcExt, inclCD, arcsFirst))
   264         printf("Successful.\n");
   263         printf("Successful.\n");
   265     else
   264     else
   266         printf("Failure. reason: %s.\n", PHYSFS_getLastError());
   265         printf("Failure. reason: %s.\n", PHYSFS_getLastError());
   267 
   266 
   268     return(1);
   267     return(1);