X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=command.c;fp=command.c;h=f8d679e7add601ed0e93489f38aa4d61318368d0;hb=9d232e636d79a2321e280fe3eee6839c8f45c36f;hp=857d77f3e6477642b8e2651749e84afe095a1bd7;hpb=543dce1f349397beb941187cd3041647851445a7;p=paraslash.git diff --git a/command.c b/command.c index 857d77f3..f8d679e7 100644 --- a/command.c +++ b/command.c @@ -671,10 +671,22 @@ static int com_ff(struct command_context *cc, struct lls_parse_result *lpr) send_errctx(cc, errctx); return ret; } - if (!(ret = sscanf(lls_input(0, lpr), "%i%c", &i, &c))) - return -E_COMMAND_SYNTAX; - if (ret > 1 && c == '-') - i = -i; + ret = para_atoi32(lls_input(0, lpr), &i); + if (ret < 0) { + if (ret != -E_ATOI_JUNK_AT_END) + return ret; + /* + * Compatibility code to keep the historic syntax (ff 30-) + * working. This can be removed after 0.7.0. + */ + ret = sscanf(lls_input(0, lpr), "%i%c", &i, &c); + if (ret <= 0) + return -E_COMMAND_SYNTAX; + if (ret > 1 && c == '-') { + PARA_WARNING_LOG("use of obsolete syntax\n"); + i = -i; + } + } mutex_lock(mmd_mutex); ret = -E_NO_AUDIO_FILE; if (!mmd->afd.afhi.chunks_total || !mmd->afd.afhi.seconds_total)