Fossil SCM
Don't crash if last-sync-pw was never set yet.
Commit
a2829230611099670f238fc801ece8769a30930e
Parent
a5404e30cbb4759…
1 file changed
+2
-2
+2
-2
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -135,12 +135,12 @@ | ||
| 135 | 135 | ** Prompt to save Fossil user password |
| 136 | 136 | */ |
| 137 | 137 | int save_password_prompt(){ |
| 138 | 138 | Blob x; |
| 139 | 139 | char c; |
| 140 | - const char *old = unobscure(db_get("last-sync-pw", 0)); | |
| 141 | - if( (old!=0) && !strcmp(old, g.urlPasswd) ){ | |
| 140 | + const char *old = db_get("last-sync-pw", 0); | |
| 141 | + if( (old!=0) && !strcmp(unobscure(old), g.urlPasswd) ){ | |
| 142 | 142 | return 0; |
| 143 | 143 | } |
| 144 | 144 | prompt_user("remember password (Y/n)? ", &x); |
| 145 | 145 | c = blob_str(&x)[0]; |
| 146 | 146 | blob_reset(&x); |
| 147 | 147 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -135,12 +135,12 @@ | |
| 135 | ** Prompt to save Fossil user password |
| 136 | */ |
| 137 | int save_password_prompt(){ |
| 138 | Blob x; |
| 139 | char c; |
| 140 | const char *old = unobscure(db_get("last-sync-pw", 0)); |
| 141 | if( (old!=0) && !strcmp(old, g.urlPasswd) ){ |
| 142 | return 0; |
| 143 | } |
| 144 | prompt_user("remember password (Y/n)? ", &x); |
| 145 | c = blob_str(&x)[0]; |
| 146 | blob_reset(&x); |
| 147 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -135,12 +135,12 @@ | |
| 135 | ** Prompt to save Fossil user password |
| 136 | */ |
| 137 | int save_password_prompt(){ |
| 138 | Blob x; |
| 139 | char c; |
| 140 | const char *old = db_get("last-sync-pw", 0); |
| 141 | if( (old!=0) && !strcmp(unobscure(old), g.urlPasswd) ){ |
| 142 | return 0; |
| 143 | } |
| 144 | prompt_user("remember password (Y/n)? ", &x); |
| 145 | c = blob_str(&x)[0]; |
| 146 | blob_reset(&x); |
| 147 |