@@ -4369,24 +4369,23 @@ get_contest_id(bool *testp, char const *uuidfile, char *uuidstr)
4369
4369
/*
4370
4370
* if -U UUID not used check if -u uuidfile was used
4371
4371
*/
4372
- if (uuidstr == NULL ) {
4373
- if (uuidfile != NULL ) {
4374
- if (is_read (uuidfile )) {
4372
+ if (uuidfile != NULL ) {
4373
+ if (is_read (uuidfile )) {
4374
+ errno = 0 ; /* pre-clear errno for warnp() */
4375
+ uuidfp = fopen (uuidfile , "r" );
4376
+ if (uuidfp == NULL ) {
4377
+ warnp (__func__ , "failed to open uuidfile, will prompt instead" );
4378
+ } else {
4379
+ uuidstr = readline_dup (& linep , true, NULL , uuidfp );
4375
4380
errno = 0 ; /* pre-clear errno for warnp() */
4376
- uuidfp = fopen (uuidfile , "r" );
4377
- if (uuidfp == NULL ) {
4378
- warnp (__func__ , "failed to open uuidfile, will prompt instead" );
4379
- } else {
4380
- uuidstr = readline_dup (& linep , true, NULL , uuidfp );
4381
- errno = 0 ; /* pre-clear errno for warnp() */
4382
- if (fclose (uuidfp ) != 0 ) {
4383
- warnp (__func__ , "failed to fclose(uuidfp)" );
4384
- }
4385
- if (uuidstr != NULL ) {
4386
- if (valid_contest_id (uuidstr )) {
4387
- if (strcmp (uuidstr , "test" ) == 0 ) {
4381
+ if (fclose (uuidfp ) != 0 ) {
4382
+ warnp (__func__ , "failed to fclose(uuidfp)" );
4383
+ }
4384
+ if (uuidstr != NULL ) {
4385
+ if (valid_contest_id (uuidstr )) {
4386
+ if (strcmp (uuidstr , "test" ) == 0 ) {
4388
4387
4389
- /*
4388
+ /*
4390
4389
* report test mode
4391
4390
*/
4392
4391
para ("" ,
@@ -4409,7 +4408,7 @@ get_contest_id(bool *testp, char const *uuidfile, char *uuidstr)
4409
4408
warn (__func__ , "-u uuidfile not readable, will prompt instead" );
4410
4409
}
4411
4410
}
4412
- } else if (valid_contest_id (uuidstr )) {
4411
+ if (uuidstr != NULL && valid_contest_id (uuidstr )) {
4413
4412
/*
4414
4413
* case: IOCCC contest ID is test, quick return
4415
4414
*/
@@ -4735,7 +4734,8 @@ mk_submission_dir(char const *workdir, char const *ioccc_id, int submit_slot,
4735
4734
}
4736
4735
fpara (stderr ,
4737
4736
"" ,
4738
- "You need to move that directory, or remove it, or use a different workdir." ,
4737
+ "You need to move that directory, or remove it, use the -x option" ,
4738
+ "or use a different workdir." ,
4739
4739
"" ,
4740
4740
NULL );
4741
4741
err (161 , __func__ , "submission directory exists: %s" , submission_dir );
0 commit comments