ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.309 by root, Wed Feb 27 01:02:33 2008 UTC vs.
Revision 1.310 by root, Wed Feb 27 01:05:55 2008 UTC

522 if (rs[Rs_geometry]) 522 if (rs[Rs_geometry])
523 flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); 523 flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h);
524 524
525 if (flags & WidthValue) 525 if (flags & WidthValue)
526 { 526 {
527 if (!w)
528 rxvt_fatal ("illegal window geometry (width and height must be non-zero), aborting.\n");
529
527 ncol = clamp (w, 0, std::numeric_limits<int16_t>::max ()); 530 ncol = clamp (w, 1, std::numeric_limits<int16_t>::max ());
528 szHint.flags |= USSize; 531 szHint.flags |= USSize;
529 } 532 }
530 533
531 if (flags & HeightValue) 534 if (flags & HeightValue)
532 { 535 {
536 if (!h)
537 rxvt_fatal ("illegal window geometry (width and height must be non-zero), aborting.\n");
538
533 nrow = clamp (h, 0, std::numeric_limits<int16_t>::max ()); 539 nrow = clamp (h, 1, std::numeric_limits<int16_t>::max ());
534 szHint.flags |= USSize; 540 szHint.flags |= USSize;
535 } 541 }
536 542
537 if (flags & XValue) 543 if (flags & XValue)
538 { 544 {
559 szHint.win_gravity = SouthEastGravity; 565 szHint.win_gravity = SouthEastGravity;
560 else 566 else
561 szHint.win_gravity = SouthWestGravity; 567 szHint.win_gravity = SouthWestGravity;
562 } 568 }
563 } 569 }
564
565 if (!szHint.width || !szHint.height)
566 rxvt_fatal ("window width or height must not be zero, aborting.\n");
567 } 570 }
568 571
569 /* TODO: BOUNDS */ 572 /* TODO: BOUNDS */
570 width = ncol * fwidth; 573 width = ncol * fwidth;
571 height = nrow * fheight; 574 height = nrow * fheight;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines