summaryrefslogtreecommitdiffstats
path: root/disk-utils/cfdisk.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix menu spelling in cfdisk debug messagesKarel Zak2017-03-221-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: stop mixing declarations and codeSami Kerola2017-03-131-1/+3
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: add static keyword to where needed [smatch scan]Sami Kerola2017-02-201-3/+3
| | | | | | | text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-201-1/+1
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cfdisk: avoid use of VLA in combination with sizeof() [smatch scan]Sami Kerola2017-02-201-2/+5
| | | | | | | | | disk-utils/cfdisk.c:1066:29: error: cannot size expression One should use sizeof() only when variable size can be known at time of compilation. That is not the case with variable length arrays. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cfdisk: use buffer editor for ui_get_string()Karel Zak2017-02-161-53/+46Star
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/403 Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add copyright to helpKarel Zak2017-02-021-1/+4
| | | | | | ... to make it obvious this is a new cfdisk. Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: support UI refresh on ^LKarel Zak2017-02-011-2/+14
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/404 Signed-off-by: Karel Zak <kzak@redhat.com>
* Use --help suggestion on invalid optionKarel Zak2016-12-191-0/+2
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix mountpoint detectionKarel Zak2016-10-041-21/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfisk: add /dev/vda as another default diskKarel Zak2016-07-071-13/+23
| | | | | | | And use array for all default alternative disks. Reported-by: Thierry Vignaud <thierry.vignaud@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: use libsmartcols ASCII for non-widechar environmentKarel Zak2016-06-031-0/+4
| | | | | Reported-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: Fix various typosSebastian Rasmussen2016-05-311-1/+1
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* build-sys: remove obsolete [cs]fdisk LDADDsKarel Zak2016-05-041-4/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add --wipe-partitions=auto|never|defaultKarel Zak2016-05-041-33/+12Star
| | | | | | | | | | | | | The option allows to remove filesystes/RAIDs from newly created partitions before the partition table is updated (and partition device created). The default is "auto" in this case wipe is enabled in interactive mode only and user's confirmation (yes/no dialog) is required. Note that keep filesystem signature on partition is pretty valid use-case, so we don't erase anything by default. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk, cfdisk, sfdisk: improve the grammar of three messagesBenno Schulenberg2016-03-161-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: wipe device if create a new labelKarel Zak2016-02-181-0/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: use new libsmartcols functionality to fix outputKarel Zak2015-12-071-0/+1
| | | | | Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* Revert "cfdisk: make sure that output fits to terminal width"Karel Zak2015-12-071-13/+2Star
| | | | This reverts commit ed99eac0e2a83a315c7cf5d8a461df16b3106596.
* cfdisk, sfdisk: remove unused variablesKarel Zak2015-08-051-9/+8Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: check return value [coverity scan]Karel Zak2015-08-041-3/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: adjust grammar and punctuation of some messagesBenno Schulenberg2015-08-031-1/+1
| | | | | | | Also equalize three messages to one other one, and fix a typo in USE_COLORS_BY_DEFAULT. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: don't print obsolete CHS addressesKarel Zak2015-07-271-10/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: make sure that output fits to terminal widthKarel Zak2015-07-271-2/+13
| | | | | Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: remove extra line between menu and info lineKarel Zak2015-07-271-1/+1
| | | | | Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: spell "label" in lower caseBenno Schulenberg2015-07-271-1/+1
| | | | | | To be less shouty. It is not an abbreviation like "UUID". Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: allow an uppercase X to toggle the extra infoBenno Schulenberg2015-07-271-0/+1
| | | | | | | To make true the help text line that says that all commands can be entered with either upper or lower case. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: make sure that extra info is refreshed/removedKarel Zak2015-07-221-1/+3
| | | | | | | For example when you move from a Partition to the FreeSapce then we need to remove old extra info and draw nothing. Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: properly toggle extra info window, make it more robustKarel Zak2015-07-221-9/+31
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix condition logic [cppcheck]Boris Egorov2015-06-251-1/+1
| | | | | | | | [disk-utils/cfdisk.c:1181] -> [disk-utils/cfdisk.c:1181]: (warning) Possible null pointer dereference: data - otherwise it is redundant to check it against null. Signed-off-by: Boris Egorov <egorov@linux.com>
* cfdisk: cleanup extra partitions info for slangKarel Zak2015-03-311-35/+18Star
| | | | | | | | | | | The patch removes problem with getch() on slang, now the code is based on subwin() and extra info window is persistent. A new problem is that slang does not keep sub-window border persistent. I'm going to ignore this slang problem... use ncurses dude! Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: provide extra partinfo with "x"Ondrej Oprala2015-03-271-12/+356
| | | | | | | | | | | | | | | | | | | | | The new 'extra' info provides: * filesystem information from libblkid (TYPE, UUID, LABEL) This feature is based on libblkid ability to probe specified area on the device. It allows to probe for filesystems although the partition devices (e.g. /dev/sda2) does not exist. For example from disk image: # cfdisk /home/archive/fs-images/disk.img * additional information from libfdisk (partition UUID, Name, ...) * mount information from libmount (from fstab or mountinfo) Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com> Co-Author: Karel Zak <kzak@redhat.com>
* colors: cleanup man pages, add hint to usage()Karel Zak2015-02-251-2/+4
| | | | | | | | cfdisk, fdisk, calm dmesg and hexdump Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: improve create-label UIKarel Zak2015-02-101-11/+15
| | | | | Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: also recognize a lowercase 'l' for loading a script fileBenno Schulenberg2015-02-101-0/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: do not startle the user with a false message when --zero is usedBenno Schulenberg2015-02-101-2/+3
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: improve ui_get_size() warningsKarel Zak2015-02-031-5/+10
| | | | | | | | | - don't reset to default after error - clean previous warnings after users response - remove unnecessary warning Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix issues with very small partitionsKarel Zak2015-02-031-2/+3
| | | | | | | | | | | | - cfdisk: minimal partitions size is 1 sector - dos: when align last sector then don't set partition size to zero for very small partitions. - don't ignore tiny partitions before free space when define free-space start offset - improve some debug messages Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: print "wrong order" warning after startup, colorize info messagesKarel Zak2015-02-031-2/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: force main menu to default to Quit/New menu itemsKarel Zak2015-02-031-8/+13
| | | | | Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: disable some KEY_* in ui_get_wqstring()Karel Zak2015-02-021-0/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: default to Quit menu itemKarel Zak2015-02-021-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: make '?' an alias of 'h', to also show the help screenBenno Schulenberg2015-02-021-0/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: punctuate the bottombar messages consistentlyBenno Schulenberg2015-02-021-6/+6
| | | | | | Also adjust the style of two comments and add another. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: improve wording and consistency of the size warningsBenno Schulenberg2015-02-021-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: remove the mistaken B from the explanation of size suffixesBenno Schulenberg2015-02-021-2/+2
| | | | | | | Also reword the explanation to be clearer. It is not necessary to be complete -- that is what the man page is for. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: fix mem leak and main_menu_action() logic [coverity scan]Karel Zak2015-01-281-6/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: actually translate the table headers and the bottom lineBenno Schulenberg2015-01-261-2/+2
| | | | | | | The printout of the table headers and the bottomline descriptions were lacking calls to gettext(). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: shorten the help screen to make it fit within 25 linesBenno Schulenberg2015-01-261-14/+7Star
| | | | | | | | | | When the terminal has less than 32 lines, the new cfdisk ignored the fact that the help-screen text was longer and just skipped printing the remaining lines. Instead of introducing a minipager for the help screen, just condense its text and remove unneeded lines. Now the text occupies just 25 lines, which should fit on most terminals. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: don't mess up the help screen by printing the PO file headerBenno Schulenberg2015-01-261-6/+5Star
| | | | | | | | | Asking for the translation of the empty string ("") produces the header of the PO file corresponding to the current locale, which messes up the help screen. So, don't use empty strings in the array of help strings but (arbitrary) double spaces. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>