Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/dvdrip
[dvdrip] / dvd-info.c
index dd6b708..93d9567 100644 (file)
@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
   if (f&f_bogus) { usage(stderr); exit(2); }
   setlocale(LC_ALL, "");
   progress_init(&progress);
-  dvdfn = argv[optind]; open_dvd(dvdfn, 0, &dvd);
+  dvdfn = argv[optind]; open_dvd(dvdfn, O_RDONLY, 0, &dvd);
   vmgi = ifoOpenVMGI(dvd);
   if (!vmgi) bail("failed to open vmgi for `%s'", dvdfn);
 
@@ -212,14 +212,14 @@ int main(int argc, char *argv[])
                     "title number");
       nch = nchapters(ti);
       if (*p != '.') {
-       loch = 1; hich = nch;
+       loch = 1; hich = -1;
       } else {
        p++; loch = parse_int(&p, PNF_JUNK, 1, nch, "low chapter");
        if (*p != '-')
          hich = loch;
        else {
          p++;
-         if (!*p) hich = nch;
+         if (!*p) hich = -1;
          else hich = parse_int(&p, PNF_JUNK, loch, nch, "high chapter");
        }
       }